Add Grazie-backed grammar checker and dictionary support to Lyng IDEA plugin and variants for replacements with or without Grazie interfaces

This commit is contained in:
sergeych committed 2025-12-03 01:29:34 +01:00
1 parent fbea13570e
commit 2e17297355
20 files changed
+2363 -4

No files matched your search

@@ -0,0 +1,29 @@
<!--
~ Copyright 2025 Sergey S. Chernov real.sergeych@gmail.com
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<!--
Grazie (bundled Natural Languages) optional descriptor for Lyng. Loaded when plugin ID com.intellij.grazie is present.
-->
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<grazie.grammar.strategy language="Lyng"
implementationClass="net.sergeych.lyng.idea.grazie.LyngGrazieStrategy"/>
<!-- Provide text extraction for Lyng PSI so Grazie (bundled Natural Languages) can check content -->
<grazie.textExtractor language="Lyng"
implementationClass="net.sergeych.lyng.idea.grazie.LyngTextExtractor"/>
</extensions>
</idea-plugin>
@@ -0,0 +1,30 @@
<!--
~ Copyright 2025 Sergey S. Chernov real.sergeych@gmail.com
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<!--
Grazie Lite/Pro optional descriptor for Lyng. Loaded when plugin ID tanvd.grazi is present.
It delegates to the same strategy class as the bundled Natural Languages.
-->
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<grazie.grammar.strategy language="Lyng"
implementationClass="net.sergeych.lyng.idea.grazie.LyngGrazieStrategy"/>
<!-- Provide text extraction for Lyng PSI so Grazie can actually check content -->
<grazie.textExtractor language="Lyng"
implementationClass="net.sergeych.lyng.idea.grazie.LyngTextExtractor"/>
</extensions>
</idea-plugin>
@@ -0,0 +1,28 @@
<!--
~ Copyright 2025 Sergey S. Chernov real.sergeych@gmail.com
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<!--
Grazie (Lite/Pro/bundled) grammar checker extensions for Lyng. Loaded only when
the Grazie plugin is present. plugin.xml declares optional dependency with this config file.
-->
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<!-- Register Lyng strategy for Grazie (Natural Languages). -->
<grazie.grammar.strategy language="Lyng"
implementationClass="net.sergeych.lyng.idea.grazie.LyngGrazieStrategy"/>
</extensions>
</idea-plugin>
@@ -33,6 +33,12 @@
<depends>com.intellij.modules.platform</depends>
<!-- Needed for editor language features (syntax highlighting, etc.) -->
<depends>com.intellij.modules.lang</depends>
<!-- Spellchecker support (optional). If present, load spellchecker.xml which registers our strategy. -->
<depends optional="true" config-file="spellchecker.xml">com.intellij.spellchecker</depends>
<!-- Grazie (Lite/Pro) grammar checker support (optional). If present, load grazie-lite.xml -->
<depends optional="true" config-file="grazie-lite.xml">tanvd.grazi</depends>
<!-- Some IDE builds may expose Grazie/Natural Languages under another ID; load grazie-bundled.xml -->
<depends optional="true" config-file="grazie-bundled.xml">com.intellij.grazie</depends>
<extensions defaultExtensionNs="com.intellij">
<!-- Language and file type -->
@@ -50,6 +56,9 @@
<!-- External annotator for semantic highlighting -->
<externalAnnotator language="Lyng" implementationClass="net.sergeych.lyng.idea.annotators.LyngExternalAnnotator"/>
<!-- Grazie-backed spell/grammar annotator (runs only when Grazie is installed) -->
<externalAnnotator language="Lyng" implementationClass="net.sergeych.lyng.idea.grazie.LyngGrazieAnnotator"/>
<!-- Quick documentation provider bound to Lyng language -->
<lang.documentationProvider language="Lyng" implementationClass="net.sergeych.lyng.idea.docs.LyngDocumentationProvider"/>
@@ -80,6 +89,7 @@
<!-- If targeting SDKs with stable RawText API, the EP below can be enabled instead: -->
<!-- <copyPastePreProcessor implementation="net.sergeych.lyng.idea.editor.LyngCopyPastePreProcessor"/> -->
</extensions>
<actions/>
@@ -0,0 +1,29 @@
<!--
~ Copyright 2025 Sergey S. Chernov real.sergeych@gmail.com
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<!--
Spellchecker extensions for Lyng are registered here and loaded only when
the com.intellij.spellchecker plugin is available. The dependency is marked
optional in plugin.xml with config-file="spellchecker.xml".
-->
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<!-- Spellchecker strategy: identifiers + comments; literals configurable, skipping printf-like specs -->
<spellchecker.support language="Lyng"
implementationClass="net.sergeych.lyng.idea.spell.LyngSpellcheckingStrategy"/>
</extensions>
</idea-plugin>