Skip to content

Commit 32d1f74

Browse files
committed
Update script for LSP 3.16.0
1 parent 25ff674 commit 32d1f74

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scripts/generateFiles.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import * as fs from "fs";
33
import * as path from "path";
44
import fetch from "isomorphic-fetch";
55

6-
const lspVersion = "3.15.0";
7-
const lspRepoRevision = "66cf1d7908f6548c8262b82572c51c7d029dfbdf";
6+
const lspVersion = "3.16.0";
7+
const lspRepoRevision = "b8e6fead8c011ee4ca6547cc421dd41e3a4c3028";
88
const rootDir = path.normalize(path.join(__dirname, ".."));
99
const tempDir = path.join(rootDir, "tmp");
1010
const protocolMdPath = path.join(tempDir, lspRepoRevision, "protocol.md");
@@ -24,7 +24,7 @@ const createFile = (filePath: string, content: string) => {
2424
};
2525

2626
const extractTypeScriptSource = (content: string) => {
27-
const regEx = /^```typescript\r\n([^]*?)^```\r\n/gm;
27+
const regEx = /^```typescript\r?\n([^]*?)^```\r?\n/gm;
2828
let match;
2929
let result = "";
3030

@@ -241,6 +241,9 @@ Handlebars.registerHelper("local_var", (s) => {
241241
Handlebars.registerHelper("const", (s) => {
242242
return snake(s).toUpperCase();
243243
});
244+
Handlebars.registerHelper("isliteral", (s: string) => {
245+
return s.match(/'.*'/) || s.match(/".*"/) || s.match(/\d+/);
246+
});
244247

245248
(async () => {
246249
if (!fs.existsSync(protocolMdPath)) {
@@ -362,7 +365,11 @@ module LanguageServer
362365
{{comment documentation indent=8}}
363366
#
364367
{{/if}}
368+
{{#if (isliteral value)}}
365369
{{const name}} = {{value}}
370+
{{else}}
371+
{{const name}} = {{const value}}
372+
{{/if}}
366373
{{/each}}
367374
end
368375
end

0 commit comments

Comments
 (0)