Skip to content

Commit deacb61

Browse files
committed
Fix resolving a tsconfig directory to a file path
When a project is configured with its tsconfig pointing to a directory rather than a file, it needs to be resolved to a file before trying to read the contents of the file. Fixes #481. I've raised this as an upstream issue too via volarjs/volar.js#283.
1 parent bf88035 commit deacb61

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

packages/language-server/lib/index.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,17 @@ connection.onInitialize(async (parameters) => {
5252
createTypeScriptProject(
5353
typescript,
5454
diagnosticMessages,
55-
({configFileName}) => ({
56-
languagePlugins: getLanguagePlugins(configFileName)
57-
})
55+
({configFileName}) => {
56+
// Workaround for https://github.com/volarjs/volar.js/issues/283
57+
configFileName &&= typescript.findConfigFile(
58+
configFileName,
59+
typescript.sys.fileExists
60+
)
61+
62+
return {
63+
languagePlugins: getLanguagePlugins(configFileName)
64+
}
65+
}
5866
),
5967
getLanguageServicePlugins()
6068
)

0 commit comments

Comments
 (0)