Skip to content

Commit a6bc177

Browse files
author
Loïc Mangeonjean
committed
fix: allow fetching files without extensions
1 parent 4a7cbc3 commit a6bc177

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/extensions.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ class InfrastructureTextFileSystemProvider implements IFileSystemProviderWithFil
8585

8686
private cachedContent: Map<string, Promise<string | undefined>> = new Map()
8787
private async getFileContent (resource: monaco.Uri): Promise<string | undefined> {
88-
if (!this.cachedContent.has(resource.toString()) && resource.toString().includes('.')) {
88+
const REMOTE_FILE_BLACKLIST = ['.git/config', '.vscode', monaco.Uri.parse(this.infrastructure.rootUri).path]
89+
90+
const blacklisted = REMOTE_FILE_BLACKLIST.some(blacklisted => resource.path.endsWith(blacklisted))
91+
if (blacklisted) {
92+
return undefined
93+
}
94+
if (!this.cachedContent.has(resource.toString())) {
8995
this.cachedContent.set(resource.toString(), this.infrastructure.getFileContent!(resource, this.languageClientManager))
9096
}
9197
return await this.cachedContent.get(resource.toString())

0 commit comments

Comments
 (0)