diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-11-19 15:39:29 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-11-19 15:39:29 +0100 |
commit | a6731b58aa5b50c14b5fa1c90d07dc25eef25a40 (patch) | |
tree | d3fad743de524811aa2a2c2febbc224bc0ef4bb7 /integration | |
parent | 02157d4f509d5723a20ab126e77b576d73697774 (diff) |
Cleanup
Diffstat (limited to 'integration')
-rw-r--r-- | integration/intellij/BACKLOG.md | 65 | ||||
-rw-r--r-- | integration/intellij/README.md | 18 |
2 files changed, 52 insertions, 31 deletions
diff --git a/integration/intellij/BACKLOG.md b/integration/intellij/BACKLOG.md index 19e185dcc6b..e456aabc800 100644 --- a/integration/intellij/BACKLOG.md +++ b/integration/intellij/BACKLOG.md @@ -1,34 +1,37 @@ ### Open Issues -1. In some cases, the grammar prefers not to enforce bad syntax, because if the parser encounters bad syntax it stops -and can't build the PSI tree. That means none of the features will work for a file like that. For example, in cases -where an element supposes to have zero-to-one occurrences, the grammar will treat it as zero-to-many. -2. In order to enable the grammar recognize some keywords as identifiers (e.g. "filter" as a field's name), the -identifier rule (named "IdentifierVal") wraps the regex (ID_REG) and the KeywordOrIdentifier rule (which contains all -the keywords in the language). -3. The implementation of the GoTo Declaration feature is not exactly the same as IntelliJ. In IntelliJ if a reference -has several declarations, after clicking "Goto Declaration" there is a little window with all the declarations to choose -from. It can be done by changing the method "multiResolve" in SdReference.java to return more than one declaration. The -problem with that is that it causes the "Find Usages" feature to not work. For now, I decided to make the plugin -"Goto Declaration" feature show only the most specific declaration by the right rank-profile scope. -4. The "Find Usages" window can group usages only under rank-profiles and document-summaries. Other usages appear -directly under the .sd file. In order to create another group type of usages' group, you'll need to create 2 classes: -one for the extension "fileStructureGroupRuleProvider" (e.g. SdRankProfileGroupingRuleProvider.java), and one for the +In some cases, the parser stops on bad syntax and can't build the PSI tree. +That means no features will work in the file. + +To enable the grammar recognize some keywords as identifiers (e.g. "filter" as a field's name), +the identifier rule (named "IdentifierVal") wraps the regex (ID_REG) and the KeywordOrIdentifier +rule (which contains all the keywords in the language). + +The implementation of the GoTo Declaration feature is not exactly the same as IntelliJ. +In IntelliJ if a reference has several declarations, after clicking "Goto Declaration" +there is a little window with all the declarations to choose from. +It can be done by changing the method "multiResolve" in SdReference.java to return +more than one declaration. The problem with that is that it causes the "Find Usages" +feature to not work. For now the plugin "Goto Declaration" feature shows only the +most specific declaration by the right rank-profile scope. + +The "Find Usages" window can group usages only under rank-profiles and document-summaries. +Other usages appear directly under the .sd file. To create another group type of usages' group, +you'll need to create 2 classes: one for the extension "fileStructureGroupRuleProvider" +(e.g. SdRankProfileGroupingRuleProvider.java), and one for the grouping rule itself (e.g. SdRankProfileGroupingRule.java). -Another open problem is that the navigation isn't working in the current grouping rules. It means that when clicking on -the group headline (e.g. some name of a rank-profile) the IDE doesn't "jump" to the matching declaration. -5. Goto declaration doesn't work for document's inherits. e.g. if document A inherits from document B, B doesn't have a -reference to its declaration. -6. There aren't any tests for the plugin. - -### Some useful links: -1. JetBrains official tutorials: https://plugins.jetbrains.com/docs/intellij/custom-language-support.html and -https://plugins.jetbrains.com/docs/intellij/custom-language-support-tutorial.html -2. Grammar-Kit HOWTO: Helps to understand the BNF syntax. - https://github.com/JetBrains/Grammar-Kit/blob/master/HOWTO.md -3. How to deal with left-recursion in the grammar (in SD for example it happens in expressions). Last answer here: -https://intellij-support.jetbrains.com/hc/en-us/community/posts/360001258300-What-s-the-alternative-to-left-recursion-in-GrammarKit- -4. Great tutorial for a custom-language-plugin, but only for the basics (mainly the parser and lexer): - https://medium.com/@shan1024/custom-language-plugin-development-for-intellij-idea-part-01-d6a41ab96bc9 -5. Code of Dart (some custom language) plugin for IntelliJ: -https://github.com/JetBrains/intellij-plugins/tree/0f07ca63355d5530b441ca566c98f17c560e77f8/Dart
\ No newline at end of file +Another open problem is that the navigation isn't working in the current grouping rules. +It means that when clicking on the group headline (e.g. some name of a rank-profile) +the IDE doesn't "jump" to the matching declaration. + +Goto declaration doesn't work for document and schema inherits. E.g. if document A inherits from +document B, B doesn't have a reference to its declaration. + +There aren't any tests for the plugin. + +Semicolons in indexing statements are marked with red background for some reason. +They are not marked as errors. + +Type suggestions should include all primitive types, not just annotations + +Even if the parser continues, only the first error in a file is marked. diff --git a/integration/intellij/README.md b/integration/intellij/README.md index 36cefc22477..fec547f8a06 100644 --- a/integration/intellij/README.md +++ b/integration/intellij/README.md @@ -32,3 +32,21 @@ However, gradle is configured with a maven directory layout. With the first (?), you can run the gradle task "intellij/runIde" (or "./gradlew runIde" in the command line), open a project with some sd file and see how the plugin works on it. + + +## Some useful links: + +1. JetBrains official tutorials: https://plugins.jetbrains.com/docs/intellij/custom-language-support.html and + https://plugins.jetbrains.com/docs/intellij/custom-language-support-tutorial.html + +2. Grammar-Kit HOWTO: Helps to understand the BNF syntax. + https://github.com/JetBrains/Grammar-Kit/blob/master/HOWTO.md + +3. How to deal with left-recursion in the grammar (in SD for example it happens in expressions). Last answer here: + https://intellij-support.jetbrains.com/hc/en-us/community/posts/360001258300-What-s-the-alternative-to-left-recursion-in-GrammarKit- + +4. Great tutorial for a custom-language-plugin, but only for the basics (mainly the parser and lexer): + https://medium.com/@shan1024/custom-language-plugin-development-for-intellij-idea-part-01-d6a41ab96bc9 + +5. Code of Dart (some custom language) plugin for IntelliJ: + https://github.com/JetBrains/intellij-plugins/tree/0f07ca63355d5530b441ca566c98f17c560e77f8/Dart
\ No newline at end of file |