@volar/typescript 1.2.0-alpha.7 → 1.2.0-alpha.8

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/out/getProgram.js +12 -1
  2. package/package.json +3 -3
package/out/getProgram.js CHANGED
@@ -122,7 +122,18 @@ function getProgram(ts, core, ls) {
122
122
  }
123
123
  }
124
124
  else {
125
- file = ts.createSourceFile(fileName, docText, fileName.endsWith('.vue') || fileName.endsWith('.md') || fileName.endsWith('.html') ? ts.ScriptTarget.JSON : ts.ScriptTarget.Latest);
125
+ let scriptTarget = ts.ScriptTarget.JSON;
126
+ if (fileName.endsWith('.js')
127
+ || fileName.endsWith('.ts')
128
+ || fileName.endsWith('.jsx')
129
+ || fileName.endsWith('.tsx')
130
+ || fileName.endsWith('.mjs')
131
+ || fileName.endsWith('.mts')
132
+ || fileName.endsWith('.cjs')
133
+ || fileName.endsWith('.cts')) {
134
+ scriptTarget = ts.ScriptTarget.Latest;
135
+ }
136
+ file = ts.createSourceFile(fileName, docText, scriptTarget);
126
137
  }
127
138
  }
128
139
  const newDiagnostic = Object.assign(Object.assign({}, diagnostic), { file, start: start, length: end - start });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/typescript",
3
- "version": "1.2.0-alpha.7",
3
+ "version": "1.2.0-alpha.8",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -13,7 +13,7 @@
13
13
  "directory": "packages/typescript"
14
14
  },
15
15
  "dependencies": {
16
- "@volar/language-core": "1.2.0-alpha.7"
16
+ "@volar/language-core": "1.2.0-alpha.8"
17
17
  },
18
- "gitHead": "5811cdb90f68a2db0166aafadcce3f953156c9a3"
18
+ "gitHead": "9437b4560f35d2a153a9e2ae0dd0f64285bbb3b3"
19
19
  }