-
Hi there, I have been looking forward for this plugin for years! I am not a coder, I am a designer that use Speedata Publisher to do create digital and offset printing documents. This LuaTeX based typography software uses XML schema to organize its xml structure. So far, as XML editor + schema, I have been using VSCode with Scholarly XML, but using Geany would be for me a great achievement for many reasons.
Alternatively is available I don't know if these XML Language Server are compatible with Thanks in advance! 🙏 Cicorione! |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 30 replies
-
It doesn't really matter in what language the LSP server is written (it's run as a separate process independently of the editor) - it just has to be a LSP server.
This one seems to be a LSP server. I'm on an ARM macBook with a ARM linux virtual machine so the x86 binaries won't work for me but you can give it a try. In principle just follow https://github.com/techee/geany-lsp?tab=readme-ov-file#quick-start and in step 3 add something like this to the configuration file [XML]
cmd=/full/path/to/the/downloaded/binary/lemminx-linux Also check the documentation of |
Beta Was this translation helpful? Give feedback.
-
All right, I got an email notification with your post but don't see it anywhere here, strange. You mention you tried [XML]
cmd="java -jar /home/cicorione/.vscode/extensions/redhat.vscode-xml-0.27.1/server/org.eclipse.lemminx-0.28.0-uber.jar" and got this error
The problem is that there should be no apostrophes after Try
Also, try this command first in the console - it should just block until you terminate it with Ctrl+C. If it just prints some info and terminates by itself, have a look at its documentation and make sure the server is configured so it communicates with the client over stdin/stdout. |
Beta Was this translation helpful? Give feedback.
-
I get it, it is enabling schema through <?xml-model href="/home/cicorione/git/publisher/schema/layoutschema-en.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?> However is doing it wrong... 🤔 |
Beta Was this translation helpful? Give feedback.
-
All right, I installed vscode with the plugin to investigate more and found this issue: I've added a workaround to the plugin so if you git pull the latest version of the plugin and recompile it, it should start working much better (well, document syncing didn't work at all because of this problem). Second thing to note - when you start playing with the configuration, enclose the whole configuration from #41 (reply in thread) into {
"settings": {
"xml": {
"trace": {
"server": "verbose"
},
"catalogs": [],
"logs": {
"client": true,
"file": "/home/cicorione/lsp4xml.log"
},
"format": {
"splitAttributes": true,
"joinCDATALines": false,
"joinContentLines": false,
"joinCommentLines": false,
"spaceBeforeEmptyCloseTag": false,
"enabled": true
}
}
}
} I didn't investigate more but this should bring you to the right track. |
Beta Was this translation helpful? Give feedback.
-
Seems to work on my machine - I took some sample from www.w3schools.com and created <?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.w3schools.com"
xmlns="https://www.w3schools.com"
elementFormDefault="qualified">
<xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema> Then I took <?xml version="1.0"?>
<note xmlns="https://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.w3schools.com note.xsd">
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note> and modified it to contain invalid xml and this is what I get: |
Beta Was this translation helpful? Give feedback.
-
I do believe I made this working for my use case, you need the catalog assigned in the
That I am already using with the What is definitely is a message in the status bar that says the XML is valid or invalid as in this example: Do I need to open a bug request to you or to the general Geany project? Thanks... 🙏 |
Beta Was this translation helpful? Give feedback.
-
When I use these settings the server won't work: {
"settings": {
"xml": {
"trace": {
"server": "verbose"
},
"catalogs": ["/home/cicorione/git/publisher/schema/catalog-schema-en.xml"],
"logs": {
"client": true,
"file": "/home/freezr/lsp4xml.log"
},
"format": {
"splitAttributes": true,
"joinCDATALines": false,
"joinContentLines": false,
"joinCommentLines": false,
"spaceBeforeEmptyCloseTag": false,
"enabled": true
},
"completion": {
"autoCloseTags": true
},
"validation": {
"noGrammar": "hint",
"enabled": true,
"schema": true
}
}
}
} The documentation states:
However it is not working the way I expect... 😩 |
Beta Was this translation helpful? Give feedback.
-
It's weird because this "works" for me (with some problems which I'll investigate). I just downloaded the schema you pointed me to, updated For reference, this is the LSP plugin settings I use: [XML]
cmd=java -jar /home/parallels/.vscode/extensions/redhat.vscode-xml-0.27.1/server/org.eclipse.lemminx-0.28.0-uber.jar
initialization_options_file=/home/parallels/init_options.json and this is the contents of {
"settings": {
"xml": {
"trace": {
"server": "verbose"
},
"catalogs": [],
"logs": {
"client": true,
"file": "/home/parallels/lsp4xml.log"
},
"format": {
"splitAttributes": true,
"joinCDATALines": false,
"joinContentLines": false,
"joinCommentLines": false,
"spaceBeforeEmptyCloseTag": false,
"enabled": true
}
}
}
} Now to what "works" means:
I'm on an ARM64 macOS machine and cannot investigate this easily. First I'd suggest to run the binary from the command-line to see if you can execute it. Also, when started, it should just block until you press Ctrl+C. Then, check what the Status window of Geany says and if this server is getting started or not. |
Beta Was this translation helpful? Give feedback.
-
I found the pebcak, there was an issue in the Rewatching the gif I realized that after putting the right tag ( |
Beta Was this translation helpful? Give feedback.
-
This should be fixed now when you add this settings under the [XML] section: autocomplete_use_snippets=true You might also want to add diagnostics_statusbar_severity=4 to show issues in the status bar with lower severity - e.g. when schema link is missing in the XML document.
I assume by "hints" you mean the autocompletion window, right? I think in the previous commits autocompletion just didn't work right - there's no space in the server's response for autocompletion trigger characters so the autocompletion window shouldn't appear after space.
If there are some problems, please let me know. Maybe test first in vscode though - some problems may be specific to the lemminx server and should possibly be reported there.
This comes from Geany, not the plugin, see https://www.geany.org/manual/current/index.html#statusbar-templates so this cannot be controlled by the plugin. The LSP plugin doesn't know anything about XML, schemas, etc. These are all handled by the server and I don't plan to do any language-specific things as I want the plugin to work more or less identically for all servers and languages. |
Beta Was this translation helpful? Give feedback.
-
I'm not quite sure I understand what you are talking about - could you post a screenshot?
Good to hear the plugin is useful for someone! |
Beta Was this translation helpful? Give feedback.
-
Alright, so just to summarize this discussion for anyone wanting to use the lemminx server as the "right answer" is scattered all over the place. The configuration should look something like this: [XML]
cmd=lemminx
initialization_options_file=/home/my_home/init_options.json
autocomplete_use_label=true
autocomplete_use_snippets=true when using the The {
"settings": {
"xml": {
"trace": {
"server": "verbose"
},
"catalogs": [],
"logs": {
"client": true,
"file": "/home/my_home/lsp4xml.log"
},
"format": {
"splitAttributes": true,
"joinCDATALines": false,
"joinContentLines": false,
"joinCommentLines": false,
"spaceBeforeEmptyCloseTag": false,
"enabled": true
}
}
}
} For more information regarding the configuration, see https://github.com/eclipse/lemminx/blob/main/docs/Configuration.md |
Beta Was this translation helpful? Give feedback.
Alright, so just to summarize this discussion for anyone wanting to use the lemminx server as the "right answer" is scattered all over the place. The configuration should look something like this:
when using the
lemminx
binary which is on PATH (or alternatively using the full path), or replacecmd
withcmd=java -jar lemminx.jar
when using jar (or whatever thejar
file is named).The
init_options.json
file may contain something like this: