haidubogdan commented on code in PR #8401:
URL: https://github.com/apache/netbeans/pull/8401#discussion_r2127532107


##########
webcommon/javascript2.vue/src/org/netbeans/modules/javascript2/vue/editor/embedding/VueHtmlEmbeddingProvider.java:
##########
@@ -56,17 +61,26 @@ public List<Embedding> getEmbeddings(final Snapshot 
snapshot) {
 
         try {
             while (ts.moveNext()) {
-                Token<?> t = ts.token();
-                TokenId id = t.id();
+                Token<?> token = ts.token();
+                TokenId id = token.id();
 
-                if (id.equals(VueTokenId.HTML)) {
-                    embeddings.add(snapshot.create(ts.offset(), t.length(), 
TARGET_MIME_TYPE));
+                if (token.text() != null && id instanceof VueTokenId) {
+                    switch ((VueTokenId) id) {
+                        //javascript, css, scss, less require content 
embedding due to braces matcher issue
+                        case HTML, JAVASCRIPT, CSS -> {
+                            embeddings.add(snapshot.create(ts.offset(), 
token.length(), TARGET_MIME_TYPE));
+                        }
+                        case STYLE_SCSS, STYLE_LESS -> {
+                            String fake = new String(new 
char[token.text().length()]).replace("\0", FILLER); //NOI18N
+                            embeddings.add(snapshot.create(fake, 
TARGET_MIME_TYPE));
+                        }
+                    }

Review Comment:
   Added your update proposal.



-- 
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

Reply via email to