Bug 459073 - [css][parser] Have CSSLint produce and AST we can use in content assist
Summary: [css][parser] Have CSSLint produce and AST we can use in content assist
Status: CLOSED WONTFIX
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: JS Tools (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 458306
  Show dependency tree
 
Reported: 2015-02-03 14:10 EST by Michael Rennie CLA
Modified: 2017-01-10 15:40 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2015-02-03 14:10:36 EST
Title pretty much says it all - we should augment CSSlint (its backing parser) to produce an AST we can use to ask questions of - to help us find the context we want to propose things for.

We already have a reliable token stream we could use, but it would be much easier to have the AST computed once and walk it rather than reverse build AST node(s) on the fly to compute assist contexts (using only the token stream).
Comment 1 Michael Rennie CLA 2015-02-03 14:15:12 EST
I committed the first part of the fix + tests: 

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=a16aa119f3741ca70128cc2c2b1131b5fff273cf

The AST is available as the 'ast' property on the CSSLint result.

In its current state it is not tolerant / recoverable.
Comment 2 Michael Rennie CLA 2015-07-28 16:35:59 EDT
Here is a visitor for the AST, and the hooks to check the AST for node context:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=0465926fc303458282a67cc8ecb630268232e7e9

There are still a few missing nodes in the AST.
Comment 3 Michael Rennie CLA 2017-01-10 15:40:40 EST
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg04002.html