-
Notifications
You must be signed in to change notification settings - Fork 914
Support for env files #9075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Support for env files #9075
Conversation
ide/languages.env/src/org/netbeans/modules/languages/env/EnvLanguage.java
Outdated
Show resolved
Hide resolved
matthiasblaesing
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general good idea. The grammar seems to be incomplete. I entered DB_TEST=demo then inserted a newline and inputted D. Then I got on CLI:
[exec] line 2:1 missing ASSIGN_OPERATOR at '<EOF>'
This looks like debug output.
Entering TEST (notice the trailing space) yields:
[exec] line 1:4 missing ASSIGN_OPERATOR at '<EOF>'
[exec] SEVERE: Lexer org.netbeans.modules.languages.env.lexer.EnvLexer@7856b550
[exec] returned null token but lexerInput.readLength()=1
[exec] lexer-state: -1
[exec] tokenStartOffset=4, readOffset=5, lookaheadOffset=6
[exec] Chars: " " - these characters need to be tokenized.
[exec] Fix the lexer to not return null token in this state.
[exec] java.lang.IllegalStateException: Lexer org.netbeans.modules.languages.env.lexer.EnvLexer@7856b550
[exec] returned null token but lexerInput.readLength()=1
[exec] lexer-state: -1
[exec] tokenStartOffset=4, readOffset=5, lookaheadOffset=6
[exec] Chars: " " - these characters need to be tokenized.
[exec] Fix the lexer to not return null token in this state.
[exec] at org.netbeans.lib.lexer.LexerInputOperation.checkLexerInputFinished(LexerInputOperation.java:435)
[exec] at org.netbeans.lib.lexer.LexerInputOperation.nextToken(LexerInputOperation.java:193)
[exec] at org.netbeans.lib.lexer.BatchTokenList.tokenOrEmbeddingImpl(BatchTokenList.java:171)
[exec] at org.netbeans.lib.lexer.BatchTokenList.tokenOrEmbedding(BatchTokenList.java:166)
[exec] at org.netbeans.lib.lexer.LexerUtilsConstants.tokenIndexLazyTokenCreation(LexerUtilsConstants.java:307)
[exec] at org.netbeans.lib.lexer.BatchTokenList.tokenIndex(BatchTokenList.java:161)
[exec] at org.netbeans.api.lexer.TokenSequence.move(TokenSequence.java:650)
[exec] at org.netbeans.modules.languages.env.EnvOccurencesFinder.computeOccurrences(EnvOccurencesFinder.java:99)
[exec] at org.netbeans.modules.languages.env.EnvOccurencesFinder.run(EnvOccurencesFinder.java:60)
[exec] at org.netbeans.modules.languages.env.EnvOccurencesFinder.run(EnvOccurencesFinder.java:35)
[exec] [catch] at org.netbeans.modules.csl.editor.semantic.MarkOccurrencesHighlighter.processImpl(MarkOccurrencesHighlighter.java:157)
[exec] at org.netbeans.modules.csl.editor.semantic.MarkOccurrencesHighlighter.run(MarkOccurrencesHighlighter.java:114)
[exec] at org.netbeans.modules.csl.editor.semantic.MarkOccurrencesHighlighter.run(MarkOccurrencesHighlighter.java:59)
[exec] at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:561)
[exec] at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:786)
[exec] at org.openide.util.lookup.Lookups.executeWith(Lookups.java:288)
[exec] at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702)
[exec] at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663)
[exec] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[exec] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[exec] at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
[exec] at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
[exec] at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
[exec] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)
[exec] line 1:5 missing ASSIGN_OPERATOR at '<EOF>'
The hint integration shows an untranslated label (first linne in tree):
| <friend>org.netbeans.modules.javascript2.nodejs</friend> | ||
| <friend>org.netbeans.modules.javascript2.requirejs</friend> | ||
| <friend>org.netbeans.modules.languages.apacheconf</friend> | ||
| <friend>org.netbeans.modules.languages.env</friend> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to include the .env file in the Important Files folder for web projects.
I was thinking if it would be better to have a stand alone implementation, but so far I see that most configuration files use this dependency from web.common.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthiasblaesing
Regarding the console output, I see that on antlr language parser there is a removal of the console error listener.
I will apply the same logic.
parser.removeErrorListener(ConsoleErrorListener.INSTANCE);I will, also, try to display a better message for the syntax error.
- mime provider for .env files - coloring support - interpolated env key features like completion and declaration finder - partial ticket fix apache#6677 covering env files - include .env file in ImportantFiles node for web and php projects
3a26764 to
fe19fc5
Compare
This pull request proposes support for .env files.
Maybe it has too much features for the daily usage for these kind of files, but I think it's something to be discussed.
As the feedback progresses I can add more unit tests.
Implementations :
^Add meaningful description above
Click to collapse/expand PR instructions
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
Please make sure (eg.
git log) that all commits have a valid name and email address for you in the Author field.If you're a first time contributor, see the Contributing guidelines for more information.
If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.
PR approval and merge checklist:
If this PR targets the delivery branch: don't merge. (full wiki article)