Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 94365 - Ability to remove previously created custom embedding
Ability to remove previously created custom embedding
Status: RESOLVED FIXED
Product: editor
Classification: Unclassified
Component: Lexer
6.x
PC Linux
: P2 (vote)
: 6.x
Assigned To: issues@editor
issues@editor
: API
: 99395 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-05 13:01 UTC by Miloslav Metelka
Modified: 2007-10-10 13:51 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miloslav Metelka 2007-02-05 13:01:53 UTC
There appear to be usecases that a custom embedding created by
TokenSequence.createEmbedding() will also need to be removed explicitly under
certain situations.
For example for script tags in html if a specification of the default embedded
language will change then a parser should removed the old embeddings and create
new ones.
So the API should be like
TokenSequence.removeEmbedding(LanguagePath)
Comment 1 Miloslav Metelka 2007-09-02 23:31:19 UTC
Will be implemented in 6.0.
Comment 2 Miloslav Metelka 2007-09-02 23:32:24 UTC
*** Issue 99395 has been marked as a duplicate of this issue. ***
Comment 3 Miloslav Metelka 2007-09-11 09:46:52 UTC
Marku, I'm trying to sort out things that are not strictly needed for 6.0 and this is one of the candidates. Can this be
waived for 6.0?
Comment 4 Marek Fukala 2007-09-11 10:02:05 UTC
I think we can live without this. It also depends on the behaviour of the infrastructure - when it relexes the embedded
tokens based on change of the higher level language. For example having this:

<a onclick="jupiii()"/>

I create the javascript embedding on the jupiii() part. Then if user changes the name of the attribute or somehow
invalidates the tag the embedding should be removed. This can be done either by me (I'll diff the previous and new set
of embeddings and create/remove the diff) or by the infrastructure. In the second case it can probably work just in some
simple cases.
Comment 5 Miloslav Metelka 2007-10-05 14:41:44 UTC
/cvs/lexer/api/apichanges.xml,v  <--  apichanges.xml
new revision: 1.23; previous revision: 1.22
done
Checking in src/org/netbeans/lib/lexer/EmbeddingContainer.java;
/cvs/lexer/src/org/netbeans/lib/lexer/EmbeddingContainer.java,v  <--  EmbeddingContainer.java
new revision: 1.18; previous revision: 1.17
done
Checking in src/org/netbeans/lib/lexer/TokenSequenceList.java;
/cvs/lexer/src/org/netbeans/lib/lexer/TokenSequenceList.java,v  <--  TokenSequenceList.java
new revision: 1.6; previous revision: 1.5
done
Checking in src/org/netbeans/lib/lexer/TokenHierarchyUpdate.java;
/cvs/lexer/src/org/netbeans/lib/lexer/TokenHierarchyUpdate.java,v  <--  TokenHierarchyUpdate.java
new revision: 1.8; previous revision: 1.7
done
Checking in nbproject/project.properties;
/cvs/lexer/nbproject/project.properties,v  <--  project.properties
new revision: 1.17; previous revision: 1.16
done
Checking in src/org/netbeans/api/lexer/TokenSequence.java;
/cvs/lexer/src/org/netbeans/api/lexer/TokenSequence.java,v  <--  TokenSequence.java
new revision: 1.19; previous revision: 1.18
done
Checking in src/org/netbeans/api/lexer/TokenHierarchyEventType.java;
/cvs/lexer/src/org/netbeans/api/lexer/TokenHierarchyEventType.java,v  <--  TokenHierarchyEventType.java
new revision: 1.4; previous revision: 1.3
done
Checking in src/org/netbeans/lib/lexer/inc/MutableTokenList.java;
/cvs/lexer/src/org/netbeans/lib/lexer/inc/MutableTokenList.java,v  <--  MutableTokenList.java
new revision: 1.7; previous revision: 1.6
done
Checking in test/unit/src/org/netbeans/lib/lexer/test/simple/CustomEmbeddingTest.java;
/cvs/lexer/test/unit/src/org/netbeans/lib/lexer/test/simple/CustomEmbeddingTest.java,v  <--  CustomEmbeddingTest.java
new revision: 1.5; previous revision: 1.4

However I need to further improve the current token hierarchy's version increasing so that the token sequences scanning
the embedding being removed would be invalidated while the token sequence on which the removeEmbedding() is being called
would still be functional. I'll fix it and close the issue then.
Comment 6 Miloslav Metelka 2007-10-10 13:51:55 UTC
Additional fix invalidating the obsolete token seqences of removed embeddings.
Checking in src/org/netbeans/lib/lexer/EmbeddedTokenList.java;
/cvs/lexer/src/org/netbeans/lib/lexer/EmbeddedTokenList.java,v  <--  EmbeddedTokenList.java
new revision: 1.18; previous revision: 1.17
done
Checking in src/org/netbeans/lib/lexer/EmbeddingContainer.java;
/cvs/lexer/src/org/netbeans/lib/lexer/EmbeddingContainer.java,v  <--  EmbeddingContainer.java
new revision: 1.20; previous revision: 1.19
done
Checking in test/unit/src/org/netbeans/lib/lexer/test/simple/CustomEmbeddingTest.java;
/cvs/lexer/test/unit/src/org/netbeans/lib/lexer/test/simple/CustomEmbeddingTest.java,v  <--  CustomEmbeddingTest.java
new revision: 1.6; previous revision: 1.5
done
Checking in src/org/netbeans/api/lexer/TokenSequence.java;
/cvs/lexer/src/org/netbeans/api/lexer/TokenSequence.java,v  <--  TokenSequence.java
new revision: 1.20; previous revision: 1.19


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo