Repository navigation
Expand file tree
/
Copy pathdart.ts
More file actions
60 lines (48 loc) · 3.51 KB
/
Copy pathdart.ts
File metadata and controls
60 lines (48 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { versionIsAtLeast } from "../utils";
export class DartCapabilities {
public static get empty() { return new DartCapabilities("0.0.0"); }
public version: string;
constructor(dartVersion: string) {
this.version = dartVersion;
}
// Support for Dart prior to 3.2 (Flutter 3.16) is deprecated as of Nov 2025, we warned starting end of Dec 2025, and stopped supporting early Mar 2026
get isUnsupportedNow() { return !versionIsAtLeast(this.version, "3.2.0"); }
get isUnsupportedSoon() { return false; }
get omitsClassNameForConstructors() { return versionIsAtLeast(this.version, "3.10.0-0"); }
get omitsVoidForSetters() { return versionIsAtLeast(this.version, "3.3.0-0"); }
get usesDartRunForCli() { return versionIsAtLeast(this.version, "3.12.0-0"); }
get includesClassNameInNamedConstructorInWorkspaceSymbols() { return versionIsAtLeast(this.version, "3.12.0-0"); }
// TODO(dantup): Fix this when it's clearer what augmentations will look like.
get supportsAugmentations() { return versionIsAtLeast(this.version, "9.9.0-0"); }
get supportsGoToImports() { return versionIsAtLeast(this.version, "3.7.0-0"); }
get requiresDevToolsEmbedFlag() { return !versionIsAtLeast(this.version, "3.7.0-0"); }
get supportsDevToolsDtdExposedUri() { return versionIsAtLeast(this.version, "3.6.0-255"); }
get supportsDevToolsVsCodeExtensions() { return versionIsAtLeast(this.version, "3.3.0-247"); }
get supportsDevToolsDtdSidebar() { return versionIsAtLeast(this.version, "3.6.0-160"); }
get supportsDevToolsPropertyEditor() { return versionIsAtLeast(this.version, "3.8.0-171.2"); }
get supportsLspOverDtd() { return versionIsAtLeast(this.version, "3.8.0-0"); }
get supportsDtdRegisterVmService() { return versionIsAtLeast(this.version, "3.9.0-0"); }
get supportsObservatory() { return !versionIsAtLeast(this.version, "3.9.0-0"); }
get supportsMcpServer() { return versionIsAtLeast(this.version, "3.9.0-163"); } // https://github.com/dart-lang/ai/pull/206#issuecomment-3020314522
get supportsMcpServerLogFile() { return versionIsAtLeast(this.version, "3.9.0-303"); }
get mcpServerRequiresExperimentalFlag() { return !versionIsAtLeast(this.version, "3.9.0-293"); }
get supportsInteractiveForms() { return versionIsAtLeast(this.version, "3.13.0-0"); }
// https://github.com/dart-lang/ai/pull/253
// https://github.com/dart-lang/sdk/commit/d90b10c1b167663b9b51adc274ea0fdb18ba5856
get supportsMcpServerExcludeTool() { return versionIsAtLeast(this.version, "3.10.0-69"); }
/**
* Whether this version of the SDK supports DTD. This should be checked only for
* spawning DTD and not whether it's available within the extension.
*/
get supportsToolingDaemon() { return versionIsAtLeast(this.version, "3.4.0-139"); }
// This seems like a Pub bug.. skip tests for this version.
// https://github.com/dart-lang/pub/issues/4588
get hasPackageConfigTimestampIssue() { return versionIsAtLeast(this.version, "3.7.0") && !versionIsAtLeast(this.version, "3.9.0"); }
// https://github.com/dart-lang/webdev/issues/2869
get hasWebModuleNotLoadedIssue() { return versionIsAtLeast(this.version, "3.12.0") && !versionIsAtLeast(this.version, "3.14.0-0"); }
// Workaround for https://github.com/Dart-Code/Dart-Code/issues/5549
// TODO(dantup): Set an upper bound on this once the Pub issue is fixed.
get requiresTouchAfterPubGet() { return versionIsAtLeast(this.version, "3.7.0") && !versionIsAtLeast(this.version, "9.9.9"); }
// https://github.com/Dart-Code/Dart-Code/issues/5652
get hasOverrideCompletionIssue() { return !versionIsAtLeast(this.version, "3.10.0-205"); }
}