Closed
Bug 572115
Opened 15 years ago
Closed 15 years ago
Ability to highlight different kinds of modules being imported
Categories
(Skywriter Graveyard :: Syntax Highlighting, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
0.9.1
People
(Reporter: dangoor, Assigned: pcwalton)
References
Details
(Whiteboard: [FlightDeck] [goals])
From dbuchner:
One thing that we would like to have for FlightDeck is the ability syntax highlight special chunks of code that related to the module system and Jetpack specifically, here are a few examples:
requires(__) - if the required module is an official module, maybe we want to show green colored text, if it is a community generated, unofficial module, then perhaps blue, etc.
exports.__
I remember syntax highlighting being a feature of pre-0.8 Bespin, but does it have space for adding deeper logic to it as shown in the first 'requires' example above?
--
We need to drill into exactly what the definition of an "official module" is, but this seems doable.
| Reporter | ||
Updated•15 years ago
|
Whiteboard: [FlightDeck] → [FlightDeck] [goals]
| Assignee | ||
Comment 1•15 years ago
|
||
This is possible, but not in the "standard" syntax engine. Fortunately, we now have Narcissus' lexer available, so this should be doable. It will require rewiring and retesting the JavaScript syntax engine.
Status: NEW → ASSIGNED
| Reporter | ||
Comment 2•15 years ago
|
||
It's worth noting that this is for Q3.
| Assignee | ||
Comment 3•15 years ago
|
||
Complexity of this is dependent on how complete we want the feature to be. For the case of embedded Bespin, such as FlightDeck, where the embedder supplies a fixed list of known modules and the colors to highlight each one with, this should be easy (an afternoon of hacking, maybe). For hosted Bespin, where the user can configure per-project settings to this effect, it would be more difficult. Handling edge cases would also be difficult (e.g. require("jet" + "pack");, but I think we can do without them.)
| Reporter | ||
Comment 4•15 years ago
|
||
I believe that require("jet" + "pack") is actually not legal CommonJS syntax (the stuff inside require() is supposed to be statically analyzable).
Given that the prime user of this is FlightDeck, I think the simple solution will suffice. cc'ing dbuchner to be sure about that.
| Reporter | ||
Updated•15 years ago
|
Blocks: devtools924
| Assignee | ||
Comment 5•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•