MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / #resolveLanguageIdForUri

Method #resolveLanguageIdForUri

src/cm/lsp/workspace.ts:107–129  ·  view source on GitHub ↗
(uri: string)

Source from the content-addressed store, hash-verified

105 }
106
107 #resolveLanguageIdForUri(uri: string): string {
108 if (typeof this.options.resolveLanguageId === "function") {
109 const resolved = this.options.resolveLanguageId(uri);
110 if (resolved) return resolved;
111 }
112 try {
113 const mode = getModeForPath(uri);
114 if (mode?.name) {
115 return String(mode.name).toLowerCase();
116 }
117 } catch (error) {
118 this.#log(
119 "warn",
120 `Workspace failed to resolve language id for ${uri}`,
121 error,
122 );
123 console.warn(
124 `[LSP:Workspace] Failed to resolve language id for ${uri}`,
125 error,
126 );
127 }
128 return "plaintext";
129 }
130
131 syncFiles(): readonly WorkspaceFileUpdate[] {
132 const updates: WorkspaceFileUpdate[] = [];

Callers 1

Calls 3

#logMethod · 0.95
getModeForPathFunction · 0.90
StringInterface · 0.85

Tested by

no test coverage detected