haidubogdan commented on code in PR #8401: URL: https://github.com/apache/netbeans/pull/8401#discussion_r2127514933
########## webcommon/javascript2.vue/src/org/netbeans/modules/javascript2/vue/grammar/antlr4/coloring/ColoringLexerAdaptor.java: ########## @@ -76,4 +61,43 @@ public void setVarInterpolationOpened(boolean state) { public boolean isVarInterpolationOpened() { return varInterpolationOpened; } + + public void setScriptLanguage(String lang) { + scriptLanguage = lang; + } + + public void setScriptLanguage() { + scriptLanguage = extractLangFromInput(); + } + + public String getScriptLanguage() { + return scriptLanguage; + } + + public void setStyleLanguage(String lang) { + scriptLanguage = lang; + } + + public void setStyleLanguage() { + styleLanguage = extractLangFromInput(); + } + + public String getStyleLanguage() { + return styleLanguage; + } + + private String extractLangFromInput() { + String input = this.getText(); + String langAttrEq = LANG_ATTR + "="; //NOI18N + if (input == null || !input.startsWith(langAttrEq)) { + return null; + } + String langValue = input.substring(langAttrEq.length()); + //check if only quotes + if (langValue.length() == 2) { + return null; + } + + return langValue.substring(1, langValue.length() - 1); Review Comment: As it is specific to vue syntax, I think it should be ok. -- 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: notifications-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists