janja-language-server 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/server.js +11 -1
  2. package/package.json +2 -2
package/dist/server.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { access } from 'node:fs/promises';
2
- import { dirname } from 'node:path';
2
+ import { dirname, extname } from 'node:path';
3
3
  import { fileURLToPath, pathToFileURL } from 'node:url';
4
4
  import { CompletionItemKind, DiagnosticSeverity, InsertTextFormat, MarkupKind, TextDocuments, TextDocumentSyncKind, } from 'vscode-languageserver/node';
5
5
  import { TextDocument } from 'vscode-languageserver-textdocument';
@@ -149,6 +149,16 @@ export function startServer(connection) {
149
149
  catch {
150
150
  return null;
151
151
  }
152
+ if (!extname(new URL(targetUri).pathname)) {
153
+ const janjaUri = `${targetUri}.janja`;
154
+ try {
155
+ await access(fileURLToPath(janjaUri));
156
+ targetUri = janjaUri;
157
+ }
158
+ catch {
159
+ // Keep the extensionless target when it does not exist with .janja.
160
+ }
161
+ }
152
162
  return {
153
163
  uri: targetUri,
154
164
  range: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "janja-language-server",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Language server for Janja templates: diagnostics, completions and formatting",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "README.md"
41
41
  ],
42
42
  "dependencies": {
43
- "janja": "^4.5.0",
43
+ "janja": "^4.7.0",
44
44
  "vscode-languageserver": "^10.1.2",
45
45
  "vscode-languageserver-textdocument": "^1.0.15"
46
46
  },