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

Class AcodeWorkspaceFile

src/cm/lsp/workspace.ts:9–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7import type { WorkspaceFileUpdate, WorkspaceOptions } from "./types";
8
9class AcodeWorkspaceFile implements WorkspaceFile {
10 uri: string;
11 languageId: string;
12 version: number;
13 doc: Text;
14 views: Set<EditorView>;
15
16 constructor(
17 uri: string,
18 languageId: string,
19 version: number,
20 doc: Text,
21 view?: EditorView,
22 ) {
23 this.uri = uri;
24 this.languageId = languageId;
25 this.version = version;
26 this.doc = doc;
27 this.views = new Set();
28 if (view) this.views.add(view);
29 }
30
31 getView(preferred?: EditorView): EditorView | null {
32 if (preferred && this.views.has(preferred)) return preferred;
33 const iterator = this.views.values();
34 const next = iterator.next();
35 return next.done ? null : next.value;
36 }
37}
38
39export default class AcodeWorkspace extends Workspace {
40 files: AcodeWorkspaceFile[];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected