@ttsc/wasm 0.33.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.ttsc-wasm-build.json +65 -41
- package/dist/go.mod +2 -3
- package/dist/ttsc.wasm +2 -2
- package/go.mod +2 -3
- package/go.sum +4 -4
- package/host/api.go +4 -3
- package/host/fountain.go +5 -5
- package/package.json +1 -1
- package/shim-vendor/shim/ast/enums_gen.go +1 -0
- package/shim-vendor/shim/ast/go.mod +2 -2
- package/shim-vendor/shim/ast/go.sum +4 -4
- package/shim-vendor/shim/ast/neutral.go +141 -0
- package/shim-vendor/shim/astnav/go.mod +2 -2
- package/shim-vendor/shim/astnav/go.sum +4 -4
- package/shim-vendor/shim/bundled/go.mod +2 -2
- package/shim-vendor/shim/bundled/go.sum +4 -4
- package/shim-vendor/shim/checker/go.mod +2 -2
- package/shim-vendor/shim/checker/go.sum +4 -4
- package/shim-vendor/shim/compiler/go.mod +2 -2
- package/shim-vendor/shim/compiler/go.sum +4 -4
- package/shim-vendor/shim/compiler/neutral.go +213 -0
- package/shim-vendor/shim/core/go.mod +2 -2
- package/shim-vendor/shim/core/go.sum +4 -4
- package/shim-vendor/shim/diagnosticwriter/go.mod +2 -2
- package/shim-vendor/shim/diagnosticwriter/go.sum +4 -4
- package/shim-vendor/shim/lsp/go.mod +2 -2
- package/shim-vendor/shim/lsp/go.sum +4 -4
- package/shim-vendor/shim/parser/go.mod +2 -2
- package/shim-vendor/shim/parser/go.sum +4 -4
- package/shim-vendor/shim/printer/go.mod +2 -2
- package/shim-vendor/shim/printer/go.sum +4 -4
- package/shim-vendor/shim/scanner/go.mod +2 -2
- package/shim-vendor/shim/scanner/go.sum +4 -4
- package/shim-vendor/shim/stringutil/go.mod +1 -1
- package/shim-vendor/shim/stringutil/go.sum +2 -2
- package/shim-vendor/shim/stringutil/shim.go +15 -0
- package/shim-vendor/shim/transformers/go.mod +2 -2
- package/shim-vendor/shim/transformers/go.sum +4 -4
- package/shim-vendor/shim/tsoptions/go.mod +2 -2
- package/shim-vendor/shim/tsoptions/go.sum +4 -4
- package/shim-vendor/shim/tsoptions/neutral.go +56 -0
- package/shim-vendor/shim/tspath/go.mod +1 -1
- package/shim-vendor/shim/tspath/go.sum +2 -2
- package/shim-vendor/shim/tspath/neutral.go +150 -0
- package/shim-vendor/shim/tspath/typed_paths.go +266 -0
- package/shim-vendor/shim/vfs/cachedvfs/go.mod +2 -2
- package/shim-vendor/shim/vfs/cachedvfs/go.sum +4 -4
- package/shim-vendor/shim/vfs/go.mod +2 -2
- package/shim-vendor/shim/vfs/go.sum +4 -4
- package/shim-vendor/shim/vfs/neutral.go +20 -0
- package/shim-vendor/shim/vfs/osvfs/go.mod +2 -2
- package/shim-vendor/shim/vfs/osvfs/go.sum +4 -4
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
package tspath
|
|
2
|
+
|
|
3
|
+
import innertspath "github.com/microsoft/typescript-go/internal/tspath"
|
|
4
|
+
|
|
5
|
+
// Typed path names of the TypeScript 7.1 compiler.
|
|
6
|
+
//
|
|
7
|
+
// TypeScript 7.1 types every path, while TypeScript 7.0 spells each one as a
|
|
8
|
+
// string and keys files by Path. These aliases give 7.0 the 7.1 names, so code
|
|
9
|
+
// that must compile on both compiler targets can convert a string to the type
|
|
10
|
+
// each compiler's API expects with one expression, such as RootedFilePath(name).
|
|
11
|
+
// They add no behavior: on 7.0 every typed path is the string it names.
|
|
12
|
+
|
|
13
|
+
// RootedPath is 7.1's rooted, normalized path, a string on 7.0.
|
|
14
|
+
//
|
|
15
|
+
// @evidence contracts/common.md#principled-implementation A type alias names the representation 7.0 already uses for this value, so it adds no behavior.
|
|
16
|
+
// @evidence contracts/common.md#clear-and-simple-design One alias per 7.1 name lets one expression produce each compiler's parameter type.
|
|
17
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No validation or method is attached to the 7.0 value.
|
|
18
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose names the 7.1 type and the 7.0 representation.
|
|
19
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation A type alias performs no native operation.
|
|
20
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms A type alias executes nothing.
|
|
21
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work A type alias coordinates no work.
|
|
22
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources A type alias acquires nothing.
|
|
23
|
+
type RootedPath = string
|
|
24
|
+
|
|
25
|
+
// RootedFilePath is 7.1's rooted file path, a string on 7.0.
|
|
26
|
+
//
|
|
27
|
+
// @evidence contracts/common.md#principled-implementation A type alias names the representation 7.0 already uses for this value, so it adds no behavior.
|
|
28
|
+
// @evidence contracts/common.md#clear-and-simple-design One alias per 7.1 name lets one expression produce each compiler's parameter type.
|
|
29
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No validation or method is attached to the 7.0 value.
|
|
30
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose names the 7.1 type and the 7.0 representation.
|
|
31
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation A type alias performs no native operation.
|
|
32
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms A type alias executes nothing.
|
|
33
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work A type alias coordinates no work.
|
|
34
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources A type alias acquires nothing.
|
|
35
|
+
type RootedFilePath = string
|
|
36
|
+
|
|
37
|
+
// RootedDirectoryPath is 7.1's rooted directory path, a string on 7.0.
|
|
38
|
+
//
|
|
39
|
+
// @evidence contracts/common.md#principled-implementation A type alias names the representation 7.0 already uses for this value, so it adds no behavior.
|
|
40
|
+
// @evidence contracts/common.md#clear-and-simple-design One alias per 7.1 name lets one expression produce each compiler's parameter type.
|
|
41
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No validation or method is attached to the 7.0 value.
|
|
42
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose names the 7.1 type and the 7.0 representation.
|
|
43
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation A type alias performs no native operation.
|
|
44
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms A type alias executes nothing.
|
|
45
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work A type alias coordinates no work.
|
|
46
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources A type alias acquires nothing.
|
|
47
|
+
type RootedDirectoryPath = string
|
|
48
|
+
|
|
49
|
+
// RelativePath is 7.1's relative path, a string on 7.0.
|
|
50
|
+
//
|
|
51
|
+
// @evidence contracts/common.md#principled-implementation A type alias names the representation 7.0 already uses for this value, so it adds no behavior.
|
|
52
|
+
// @evidence contracts/common.md#clear-and-simple-design One alias per 7.1 name lets one expression produce each compiler's parameter type.
|
|
53
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No validation or method is attached to the 7.0 value.
|
|
54
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose names the 7.1 type and the 7.0 representation.
|
|
55
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation A type alias performs no native operation.
|
|
56
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms A type alias executes nothing.
|
|
57
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work A type alias coordinates no work.
|
|
58
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources A type alias acquires nothing.
|
|
59
|
+
type RelativePath = string
|
|
60
|
+
|
|
61
|
+
// FileNameStem is 7.1's file name without its extension, a string on 7.0.
|
|
62
|
+
//
|
|
63
|
+
// @evidence contracts/common.md#principled-implementation A type alias names the representation 7.0 already uses for this value, so it adds no behavior.
|
|
64
|
+
// @evidence contracts/common.md#clear-and-simple-design One alias per 7.1 name lets one expression produce each compiler's parameter type.
|
|
65
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No validation or method is attached to the 7.0 value.
|
|
66
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose names the 7.1 type and the 7.0 representation.
|
|
67
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation A type alias performs no native operation.
|
|
68
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms A type alias executes nothing.
|
|
69
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work A type alias coordinates no work.
|
|
70
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources A type alias acquires nothing.
|
|
71
|
+
type FileNameStem = string
|
|
72
|
+
|
|
73
|
+
// ModuleSpecifier is 7.1's module specifier, a string on 7.0.
|
|
74
|
+
//
|
|
75
|
+
// @evidence contracts/common.md#principled-implementation A type alias names the representation 7.0 already uses for this value, so it adds no behavior.
|
|
76
|
+
// @evidence contracts/common.md#clear-and-simple-design One alias per 7.1 name lets one expression produce each compiler's parameter type.
|
|
77
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No validation or method is attached to the 7.0 value.
|
|
78
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose names the 7.1 type and the 7.0 representation.
|
|
79
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation A type alias performs no native operation.
|
|
80
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms A type alias executes nothing.
|
|
81
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work A type alias coordinates no work.
|
|
82
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources A type alias acquires nothing.
|
|
83
|
+
type ModuleSpecifier = string
|
|
84
|
+
|
|
85
|
+
// PathKey is 7.1's canonical path key, which is 7.0's Path.
|
|
86
|
+
//
|
|
87
|
+
// @evidence contracts/common.md#principled-implementation A type alias names the representation 7.0 already uses for this value, so it adds no behavior.
|
|
88
|
+
// @evidence contracts/common.md#clear-and-simple-design One alias per 7.1 name lets one expression produce each compiler's parameter type.
|
|
89
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No validation or method is attached to the 7.0 value.
|
|
90
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose names the 7.1 type and the 7.0 representation.
|
|
91
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation A type alias performs no native operation.
|
|
92
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms A type alias executes nothing.
|
|
93
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work A type alias coordinates no work.
|
|
94
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources A type alias acquires nothing.
|
|
95
|
+
type PathKey = innertspath.Path
|
|
96
|
+
|
|
97
|
+
// CaseSensitivity is TypeScript 7.1's case policy for path identity. On 7.0 it
|
|
98
|
+
// is the useCaseSensitiveFileNames boolean that the 7.0 path functions take, so
|
|
99
|
+
// a value passes to either compiler's API unchanged.
|
|
100
|
+
//
|
|
101
|
+
// @evidence contracts/common.md#principled-implementation A type alias names the representation 7.0 already uses for this value, so it adds no behavior.
|
|
102
|
+
// @evidence contracts/common.md#clear-and-simple-design One alias per 7.1 name lets one expression produce each compiler's parameter type.
|
|
103
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No validation or method is attached to the 7.0 value.
|
|
104
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose names the 7.1 type and the 7.0 representation.
|
|
105
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation A type alias performs no native operation.
|
|
106
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms A type alias executes nothing.
|
|
107
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work A type alias coordinates no work.
|
|
108
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources A type alias acquires nothing.
|
|
109
|
+
type CaseSensitivity = bool
|
|
110
|
+
|
|
111
|
+
// The two case policies, matching TypeScript 7.1's constants. CaseInsensitive
|
|
112
|
+
// is the zero value on both targets.
|
|
113
|
+
const (
|
|
114
|
+
CaseInsensitive CaseSensitivity = false
|
|
115
|
+
CaseSensitive CaseSensitivity = true
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
// Constructors of TypeScript 7.1's typed paths. 7.1 declares them in its own
|
|
119
|
+
// tspath package; here each maps to the 7.0 path function that ttsc's own 7.0
|
|
120
|
+
// code used for the same purpose, so code calling them compiles on both.
|
|
121
|
+
|
|
122
|
+
// ToRootedFilePath resolves fileName against currentDirectory and normalizes
|
|
123
|
+
// the result, as TypeScript 7.1's constructor of the same name does.
|
|
124
|
+
//
|
|
125
|
+
// @evidence contracts/common.md#principled-implementation GetNormalizedAbsolutePath combines a relative name with the directory and normalizes separators and dot segments, the rooting 7.1 performs.
|
|
126
|
+
// @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
|
|
127
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No path normalization is reimplemented here.
|
|
128
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose states the resolution and normalization.
|
|
129
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation Resolution manipulates path text only; it reads no filesystem.
|
|
130
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the normalization pass.
|
|
131
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
|
|
132
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned path.
|
|
133
|
+
func ToRootedFilePath(fileName string, currentDirectory RootedDirectoryPath) RootedFilePath {
|
|
134
|
+
return innertspath.GetNormalizedAbsolutePath(fileName, currentDirectory)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// ToRootedDirectoryPath resolves directory against currentDirectory and
|
|
138
|
+
// normalizes the result, as TypeScript 7.1's constructor of the same name does.
|
|
139
|
+
//
|
|
140
|
+
// @evidence contracts/common.md#principled-implementation GetNormalizedAbsolutePath combines a relative directory with the base and normalizes it, the rooting 7.1 performs.
|
|
141
|
+
// @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
|
|
142
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No path normalization is reimplemented here.
|
|
143
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose states the resolution and normalization.
|
|
144
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation Resolution manipulates path text only; it reads no filesystem.
|
|
145
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the normalization pass.
|
|
146
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
|
|
147
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned path.
|
|
148
|
+
func ToRootedDirectoryPath(directory string, currentDirectory RootedDirectoryPath) RootedDirectoryPath {
|
|
149
|
+
return innertspath.GetNormalizedAbsolutePath(directory, currentDirectory)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// TryRootedPathFromAbsolute normalizes an absolute path. The boolean is false,
|
|
153
|
+
// and the path empty, when path is not absolute.
|
|
154
|
+
//
|
|
155
|
+
// @evidence contracts/common.md#principled-implementation PathIsAbsolute gates the input and GetNormalizedAbsolutePath normalizes it with no base, matching 7.1's absolute-only constructor.
|
|
156
|
+
// @evidence contracts/common.md#clear-and-simple-design Two upstream calls keep the target difference inside the shim.
|
|
157
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts A relative path is refused rather than resolved against an assumed directory.
|
|
158
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose states the false result.
|
|
159
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation The check and normalization read path text only.
|
|
160
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the root check and normalization pass.
|
|
161
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
|
|
162
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned path.
|
|
163
|
+
func TryRootedPathFromAbsolute(path string) (RootedPath, bool) {
|
|
164
|
+
if !innertspath.PathIsAbsolute(path) {
|
|
165
|
+
return "", false
|
|
166
|
+
}
|
|
167
|
+
return innertspath.GetNormalizedAbsolutePath(path, ""), true
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// TryRootedFilePathFromAbsolute is TryRootedPathFromAbsolute for a file path.
|
|
171
|
+
//
|
|
172
|
+
// @evidence contracts/common.md#principled-implementation Delegates to TryRootedPathFromAbsolute; on 7.0 file and plain rooted paths share one representation.
|
|
173
|
+
// @evidence contracts/common.md#clear-and-simple-design One delegation mirrors 7.1's file-intent constructor.
|
|
174
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts The same absolute-only gate applies.
|
|
175
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose names the shared behavior.
|
|
176
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation The check and normalization read path text only.
|
|
177
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms The delegate owns the work.
|
|
178
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
|
|
179
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned path.
|
|
180
|
+
func TryRootedFilePathFromAbsolute(fileName string) (RootedFilePath, bool) {
|
|
181
|
+
return TryRootedPathFromAbsolute(fileName)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// RootedFilePathFromAbsolute normalizes a file path that the caller has
|
|
185
|
+
// already checked is absolute.
|
|
186
|
+
//
|
|
187
|
+
// @evidence contracts/common.md#principled-implementation GetNormalizedAbsolutePath with no base normalizes an absolute path, the value 7.1's constructor produces for valid input.
|
|
188
|
+
// @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
|
|
189
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No path normalization is reimplemented here.
|
|
190
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose states the caller's absolute-path precondition.
|
|
191
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation Normalization manipulates path text only.
|
|
192
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the normalization pass.
|
|
193
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
|
|
194
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned path.
|
|
195
|
+
func RootedFilePathFromAbsolute(fileName string) RootedFilePath {
|
|
196
|
+
return innertspath.GetNormalizedAbsolutePath(fileName, "")
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// RootedPathFromAbsolute normalizes a path that the caller has already checked
|
|
200
|
+
// is absolute.
|
|
201
|
+
//
|
|
202
|
+
// @evidence contracts/common.md#principled-implementation GetNormalizedAbsolutePath with no base normalizes an absolute path, the value 7.1's constructor produces for valid input.
|
|
203
|
+
// @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
|
|
204
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No path normalization is reimplemented here.
|
|
205
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose states the caller's absolute-path precondition.
|
|
206
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation Normalization manipulates path text only.
|
|
207
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the normalization pass.
|
|
208
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
|
|
209
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned path.
|
|
210
|
+
func RootedPathFromAbsolute(path string) RootedPath {
|
|
211
|
+
return innertspath.GetNormalizedAbsolutePath(path, "")
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// RootedDirectoryPathFromAbsolute normalizes a directory path that the caller
|
|
215
|
+
// has already checked is absolute.
|
|
216
|
+
//
|
|
217
|
+
// @evidence contracts/common.md#principled-implementation GetNormalizedAbsolutePath with no base normalizes an absolute path, the value 7.1's constructor produces for valid input.
|
|
218
|
+
// @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
|
|
219
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts No path normalization is reimplemented here.
|
|
220
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose states the caller's absolute-path precondition.
|
|
221
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation Normalization manipulates path text only.
|
|
222
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the normalization pass.
|
|
223
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
|
|
224
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned path.
|
|
225
|
+
func RootedDirectoryPathFromAbsolute(directory string) RootedDirectoryPath {
|
|
226
|
+
return innertspath.GetNormalizedAbsolutePath(directory, "")
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// RootedPathFromNormalized accepts a path that is already rooted and
|
|
230
|
+
// normalized. On 7.0 it is returned unchanged.
|
|
231
|
+
//
|
|
232
|
+
// @evidence contracts/common.md#principled-implementation 7.0 represents a normalized rooted path as the same string, so the value is returned unchanged.
|
|
233
|
+
// @evidence contracts/common.md#clear-and-simple-design An identity conversion mirrors 7.1's validating constructor for valid input.
|
|
234
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts The path is not altered.
|
|
235
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose states the precondition and the identity on 7.0.
|
|
236
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation The conversion reads its argument only.
|
|
237
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms An identity conversion chooses no algorithm.
|
|
238
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
|
|
239
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing.
|
|
240
|
+
func RootedPathFromNormalized(path string) RootedPath { return path }
|
|
241
|
+
|
|
242
|
+
// RootedDirectoryPathFromNormalized gives directory intent to a path that is
|
|
243
|
+
// already rooted and normalized. On 7.0 it is returned unchanged.
|
|
244
|
+
//
|
|
245
|
+
// @evidence contracts/common.md#principled-implementation 7.0 represents a normalized rooted directory as the same string, so the value is returned unchanged.
|
|
246
|
+
// @evidence contracts/common.md#clear-and-simple-design An identity conversion mirrors 7.1's intent conversion.
|
|
247
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts The path is not altered.
|
|
248
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose states the precondition and the identity on 7.0.
|
|
249
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation The conversion reads its argument only.
|
|
250
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms An identity conversion chooses no algorithm.
|
|
251
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
|
|
252
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing.
|
|
253
|
+
func RootedDirectoryPathFromNormalized(directory string) RootedDirectoryPath { return directory }
|
|
254
|
+
|
|
255
|
+
// RootedDirectoryPathFromPath gives a rooted path directory intent. On 7.0 both
|
|
256
|
+
// are the same string.
|
|
257
|
+
//
|
|
258
|
+
// @evidence contracts/common.md#principled-implementation 7.0 represents file and directory intent identically, so the value is returned unchanged.
|
|
259
|
+
// @evidence contracts/common.md#clear-and-simple-design An identity conversion mirrors 7.1's intent conversion.
|
|
260
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts The path is not altered.
|
|
261
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose states the identity on 7.0.
|
|
262
|
+
// @evidenceExclude contracts/portability.md#os-neutral-implementation The conversion reads its argument only.
|
|
263
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms An identity conversion chooses no algorithm.
|
|
264
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
|
|
265
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing.
|
|
266
|
+
func RootedDirectoryPathFromPath(path RootedPath) RootedDirectoryPath { return path }
|
|
@@ -2,6 +2,6 @@ module github.com/microsoft/typescript-go/shim/vfs/cachedvfs
|
|
|
2
2
|
|
|
3
3
|
go 1.26
|
|
4
4
|
|
|
5
|
-
require github.com/microsoft/typescript-go v0.0.0-
|
|
5
|
+
require github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b
|
|
6
6
|
|
|
7
|
-
require github.com/go-json-experiment/json v0.0.0-
|
|
7
|
+
require github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 // indirect
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
github.com/go-json-experiment/json v0.0.0-
|
|
2
|
-
github.com/go-json-experiment/json v0.0.0-
|
|
1
|
+
github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 h1:KZaTBSyshWX3MP5jukJcNSuXDQTO+rNpt0J564dX/eg=
|
|
2
|
+
github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
|
|
3
3
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
|
4
4
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
|
5
|
-
github.com/microsoft/typescript-go v0.0.0-
|
|
6
|
-
github.com/microsoft/typescript-go v0.0.0-
|
|
5
|
+
github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b h1:IgfPOv9pzPZ1sbyRHOKu3UCvhaTS0IyrkTcs6JLPqhY=
|
|
6
|
+
github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b/go.mod h1:gV4G6M8xxLNqQSRHiFOgKHlY+5YJgYPM6QwFLWllC+8=
|
|
7
7
|
golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM=
|
|
8
8
|
golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
|
9
9
|
golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw=
|
|
@@ -2,10 +2,10 @@ module github.com/microsoft/typescript-go/shim/vfs
|
|
|
2
2
|
|
|
3
3
|
go 1.26
|
|
4
4
|
|
|
5
|
-
require github.com/microsoft/typescript-go v0.0.0-
|
|
5
|
+
require github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b
|
|
6
6
|
|
|
7
7
|
require (
|
|
8
|
-
github.com/go-json-experiment/json v0.0.0-
|
|
8
|
+
github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 // indirect
|
|
9
9
|
golang.org/x/sync v0.21.0 // indirect
|
|
10
10
|
golang.org/x/sys v0.46.0 // indirect
|
|
11
11
|
)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
github.com/go-json-experiment/json v0.0.0-
|
|
2
|
-
github.com/go-json-experiment/json v0.0.0-
|
|
1
|
+
github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 h1:KZaTBSyshWX3MP5jukJcNSuXDQTO+rNpt0J564dX/eg=
|
|
2
|
+
github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
|
|
3
3
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
|
4
4
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
|
5
|
-
github.com/microsoft/typescript-go v0.0.0-
|
|
6
|
-
github.com/microsoft/typescript-go v0.0.0-
|
|
5
|
+
github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b h1:IgfPOv9pzPZ1sbyRHOKu3UCvhaTS0IyrkTcs6JLPqhY=
|
|
6
|
+
github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b/go.mod h1:gV4G6M8xxLNqQSRHiFOgKHlY+5YJgYPM6QwFLWllC+8=
|
|
7
7
|
golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM=
|
|
8
8
|
golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
|
9
9
|
golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw=
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
package vfs
|
|
2
|
+
|
|
3
|
+
import innervfs "github.com/microsoft/typescript-go/internal/vfs"
|
|
4
|
+
|
|
5
|
+
// CaseSensitivityOf reports the case policy the filesystem compares names
|
|
6
|
+
// with. TypeScript 7.0 spells it UseCaseSensitiveFileNames and TypeScript 7.1
|
|
7
|
+
// spells it CaseSensitivity; code that must compile on both compiler targets
|
|
8
|
+
// calls this function, which the 7.1 bridge declares with the same signature.
|
|
9
|
+
//
|
|
10
|
+
// @evidence contracts/common.md#principled-implementation Returns UseCaseSensitiveFileNames, the boolean that is 7.0's CaseSensitivity.
|
|
11
|
+
// @evidence contracts/common.md#clear-and-simple-design One method call keeps the target difference inside the shim.
|
|
12
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts The policy is the filesystem's own answer, not inferred from the OS name.
|
|
13
|
+
// @evidence contracts/common.md#meaningful-documentation Native prose states the two spellings and the shared signature.
|
|
14
|
+
// @evidence contracts/portability.md#os-neutral-implementation The filesystem implementation owns how it learns its case policy; this function adds no OS assumption.
|
|
15
|
+
// @evidenceExclude contracts/performance.md#efficient-algorithms The filesystem returns its stored policy.
|
|
16
|
+
// @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
|
|
17
|
+
// @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing.
|
|
18
|
+
func CaseSensitivityOf(fs innervfs.FS) bool {
|
|
19
|
+
return fs.UseCaseSensitiveFileNames()
|
|
20
|
+
}
|
|
@@ -2,10 +2,10 @@ module github.com/microsoft/typescript-go/shim/vfs/osvfs
|
|
|
2
2
|
|
|
3
3
|
go 1.26
|
|
4
4
|
|
|
5
|
-
require github.com/microsoft/typescript-go v0.0.0-
|
|
5
|
+
require github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b
|
|
6
6
|
|
|
7
7
|
require (
|
|
8
|
-
github.com/go-json-experiment/json v0.0.0-
|
|
8
|
+
github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 // indirect
|
|
9
9
|
golang.org/x/sync v0.21.0 // indirect
|
|
10
10
|
golang.org/x/sys v0.46.0 // indirect
|
|
11
11
|
)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
github.com/go-json-experiment/json v0.0.0-
|
|
2
|
-
github.com/go-json-experiment/json v0.0.0-
|
|
1
|
+
github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 h1:KZaTBSyshWX3MP5jukJcNSuXDQTO+rNpt0J564dX/eg=
|
|
2
|
+
github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
|
|
3
3
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
|
4
4
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
|
5
|
-
github.com/microsoft/typescript-go v0.0.0-
|
|
6
|
-
github.com/microsoft/typescript-go v0.0.0-
|
|
5
|
+
github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b h1:IgfPOv9pzPZ1sbyRHOKu3UCvhaTS0IyrkTcs6JLPqhY=
|
|
6
|
+
github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b/go.mod h1:gV4G6M8xxLNqQSRHiFOgKHlY+5YJgYPM6QwFLWllC+8=
|
|
7
7
|
golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM=
|
|
8
8
|
golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
|
9
9
|
golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw=
|