matthiasblaesing commented on code in PR #4649:
URL: https://github.com/apache/netbeans/pull/4649#discussion_r975682814
##########
ide/html.editor/src/org/netbeans/modules/html/editor/completion/HtmlCompletionProvider.java:
##########
@@ -386,7 +386,16 @@ public void run() {
} else {
ts.move(dotPos - 1);
if (ts.moveNext() || ts.movePrevious()) {
- if (ts.token().id() ==
HTMLTokenId.TAG_CLOSE_SYMBOL && !CharSequenceUtilities.equals("/>",
ts.token().text())) {
+ if (!CharSequenceUtilities.equals("/>",
ts.token().text()) && null != LexerUtils.followsToken(ts, HTMLTokenId.TAG_OPEN,
true, false,
+ HTMLTokenId.ARGUMENT,
+ HTMLTokenId.VALUE,
+ HTMLTokenId.VALUE_CSS,
+ HTMLTokenId.VALUE_JAVASCRIPT,
+ HTMLTokenId.OPERATOR,
+ HTMLTokenId.WS,
+ HTMLTokenId.EL_CLOSE_DELIMITER,
+ HTMLTokenId.EL_CONTENT,
+ HTMLTokenId.EL_OPEN_DELIMITER)) {
Review Comment:
In general I like this - the current behavior annoyed the hell out of me.
The second check looks to complex - If I understand correctly, you want to
check if you are behind an open tag. I would invert this and check if it is not
a closing tag.
```suggestion
if (!CharSequenceUtilities.equals("/>",
ts.token().text()) && null == LexerUtils.followsToken(ts,
HTMLTokenId.TAG_CLOSE, true, false,
HTMLTokenId.WS,
HTMLTokenId.TAG_CLOSE_SYMBOL)) {
```
The idea here is, that the definition for a closing tag is pretty simple:
https://www.w3.org/html/wg/spec/syntax.html#end-tags
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists