+1
-1
.gitignore
+1
-1
.gitignore
+159
Package.resolved
+159
Package.resolved
···
+35
-2
Package.swift
+35
-2
Package.swift
······
+9
-10
Sources/PterodactylBuild/BuildContext.swift
+9
-10
Sources/PterodactylBuild/BuildContext.swift
······+public func computeValue(_ fi: FXFunctionInterface<Self>, _ ctx: Context) async throws -> ValueType {-static func load<X: FXKey>(id: LLBDataID, in ctx: BuildContext<X>) async throws -> LLBCASFileTree {+public static func load<X: FXKey>(id: LLBDataID, in ctx: BuildContext<X>) async throws -> LLBCASFileTree {-func remove<X: FXKey>(path: AbsolutePath, in ctx: BuildContext<X>) async throws -> LLBCASFileTree {+public func remove<X: FXKey>(path: AbsolutePath, in ctx: BuildContext<X>) async throws -> LLBCASFileTree {-func traverse<X: FXKey>(root: AbsolutePath, in ctx: BuildContext<X>, _ callback: (AbsolutePath, LLBDataID, LLBDirectoryEntry) async throws -> Void) async throws {+public func traverse<X: FXKey>(root: AbsolutePath, in ctx: BuildContext<X>, _ callback: (AbsolutePath, LLBDataID, LLBDirectoryEntry) async throws -> Void) async throws {
+15
Sources/PterodactylBuild/FXValue+Conformances.swift
+15
Sources/PterodactylBuild/FXValue+Conformances.swift
···
-34
Sources/PterodactylBuild/Keys/AnalyseImports.swift
-34
Sources/PterodactylBuild/Keys/AnalyseImports.swift
···
+24
Sources/PterodactylBuild/Keys/Blob/GetLineMap.swift
+24
Sources/PterodactylBuild/Keys/Blob/GetLineMap.swift
···
+33
Sources/PterodactylBuild/Keys/Blob/ParseDocument.swift
+33
Sources/PterodactylBuild/Keys/Blob/ParseDocument.swift
···+public static let versionDependencies: [any FXVersioning.Type] = [ReadContents.self, Tokenise.self]+var recoveryHandle = parser.recoveryStack.push([.lineComment, .blockComment(terminated: true), .blockComment(terminated: false)])
+30
Sources/PterodactylBuild/Keys/Blob/ParseImports.swift
+30
Sources/PterodactylBuild/Keys/Blob/ParseImports.swift
···
+7
Sources/PterodactylBuild/Keys/Blob/README.md
+7
Sources/PterodactylBuild/Keys/Blob/README.md
···+Certain operations do not require knowledge of the entire source tree, only a specific blob inside the source tree. These include import analysis, tokenisation, line maps, parsing, etc.
+25
Sources/PterodactylBuild/Keys/Blob/ReadContents.swift
+25
Sources/PterodactylBuild/Keys/Blob/ReadContents.swift
···
+22
Sources/PterodactylBuild/Keys/Blob/Tokenise.swift
+22
Sources/PterodactylBuild/Keys/Blob/Tokenise.swift
···
-33
Sources/PterodactylBuild/Keys/DependencyGraphOfSourceTree.swift
-33
Sources/PterodactylBuild/Keys/DependencyGraphOfSourceTree.swift
···-static let versionDependencies: [any FXVersioning.Type] = [Keys.UnitMapOfSourceTree.self, Keys.AnalyseImports.self]
-7
Sources/PterodactylBuild/Keys/Keys.swift
-7
Sources/PterodactylBuild/Keys/Keys.swift
-35
Sources/PterodactylBuild/Keys/NarrowSourceTree.swift
-35
Sources/PterodactylBuild/Keys/NarrowSourceTree.swift
···-static let versionDependencies: [any FXVersioning.Type] = [TransitiveDependencies.self, UnitMapOfSourceTree.self]-let dependencies = try await ctx.request(TransitiveDependencies(sourceTreeId: sourceTreeId, unitName: unitName)).dependencies
-32
Sources/PterodactylBuild/Keys/SourceCode.swift
-32
Sources/PterodactylBuild/Keys/SourceCode.swift
···
+21
Sources/PterodactylBuild/Keys/SourceTree/GetDependencies.swift
+21
Sources/PterodactylBuild/Keys/SourceTree/GetDependencies.swift
···+static let versionDependencies: [any FXVersioning.Type] = [Keys.SourceTree.GetDependencyGraph.self]+let graph = try await ctx.request(Keys.SourceTree.GetDependencyGraph(sourceTreeId: sourceTreeId))
+30
Sources/PterodactylBuild/Keys/SourceTree/GetDependencyGraph.swift
+30
Sources/PterodactylBuild/Keys/SourceTree/GetDependencyGraph.swift
···+static let versionDependencies: [any FXVersioning.Type] = [Keys.SourceTree.GetUnitMap.self, Keys.Blob.ParseImports.self]
+24
Sources/PterodactylBuild/Keys/SourceTree/GetUnitMap.swift
+24
Sources/PterodactylBuild/Keys/SourceTree/GetUnitMap.swift
···
+31
Sources/PterodactylBuild/Keys/SourceTree/NarrowToUnit.swift
+31
Sources/PterodactylBuild/Keys/SourceTree/NarrowToUnit.swift
···+static let versionDependencies: [any FXVersioning.Type] = [GetDependencies.self, GetUnitMap.self]+let dependencies = try await ctx.request(GetDependencies(sourceTreeId: sourceTreeId, unitName: unitName))
-25
Sources/PterodactylBuild/Keys/TransitiveDependencies.swift
-25
Sources/PterodactylBuild/Keys/TransitiveDependencies.swift
···-static let versionDependencies: [any FXVersioning.Type] = [Keys.DependencyGraphOfSourceTree.self]-let graph = try await ctx.request(Keys.DependencyGraphOfSourceTree(sourceTreeId: sourceTreeId))
-25
Sources/PterodactylBuild/Keys/UnitMapOfSourceTree.swift
-25
Sources/PterodactylBuild/Keys/UnitMapOfSourceTree.swift
···
+9
Sources/PterodactylBuild/Keys.swift
+9
Sources/PterodactylBuild/Keys.swift
-1
Sources/PterodactylBuild/LLBCASFileTree+Traversal.swift
-1
Sources/PterodactylBuild/LLBCASFileTree+Traversal.swift
-1
Sources/PterodactylBuild/Types/Graph.swift
-1
Sources/PterodactylBuild/Types/Graph.swift
-1
Sources/PterodactylBuild/Types/UnitInfo.swift
-1
Sources/PterodactylBuild/Types/UnitInfo.swift
-1
Sources/PterodactylBuild/Types/UnitMap.swift
-1
Sources/PterodactylBuild/Types/UnitMap.swift
+5
-6
Sources/PterodactylBuild/Types/UnitName.swift
+5
-6
Sources/PterodactylBuild/Types/UnitName.swift
···
-1
Sources/PterodactylKernel/Control/AsyncThunk.swift
-1
Sources/PterodactylKernel/Control/AsyncThunk.swift
-1
Sources/PterodactylKernel/Core Types/FieldDict.swift
-1
Sources/PterodactylKernel/Core Types/FieldDict.swift
-1
Sources/PterodactylKernel/Core Types/Size.swift
-1
Sources/PterodactylKernel/Core Types/Size.swift
-1
Sources/PterodactylKernel/Local Analysis/Equality.swift
-1
Sources/PterodactylKernel/Local Analysis/Equality.swift
-1
Sources/PterodactylKernel/Local Analysis/LocalAnalysis.swift
-1
Sources/PterodactylKernel/Local Analysis/LocalAnalysis.swift
-1
Sources/PterodactylKernel/Local Analysis/Quotation.swift
-1
Sources/PterodactylKernel/Local Analysis/Quotation.swift
-1
Sources/PterodactylKernel/Smallness.swift
-1
Sources/PterodactylKernel/Smallness.swift
+19
Sources/PterodactylLanguageServer/AbsolutePath+URI.swift
+19
Sources/PterodactylLanguageServer/AbsolutePath+URI.swift
···
+16
Sources/PterodactylLanguageServer/Archive/LLBDeclFileTree+Singleton.swift
+16
Sources/PterodactylLanguageServer/Archive/LLBDeclFileTree+Singleton.swift
···
+12
Sources/PterodactylLanguageServer/Event Handlers/ErrorHandler.swift
+12
Sources/PterodactylLanguageServer/Event Handlers/ErrorHandler.swift
···
+56
Sources/PterodactylLanguageServer/Event Handlers/NotificationHandler.swift
+56
Sources/PterodactylLanguageServer/Event Handlers/NotificationHandler.swift
···+let blobId: LLBDataID = try await actor.storeBlob(text: text, uri: params.textDocument.uri, version: params.textDocument.version)+try await actor.publishLiveDiagnostics(blobId: blobId, uri: params.textDocument.uri, version: params.textDocument.version)+let blobId: LLBDataID = try await actor.storeBlob(text: text, uri: params.textDocument.uri, version: params.textDocument.version)+try await actor.publishLiveDiagnostics(blobId: blobId, uri: params.textDocument.uri, version: params.textDocument.version)
+153
Sources/PterodactylLanguageServer/Event Handlers/RequestHandler.swift
+153
Sources/PterodactylLanguageServer/Event Handlers/RequestHandler.swift
···+func initialize(id: JSONId, params: InitializeParams) async -> Response<InitializationResponse> {+func semanticTokensFull(id: JSONId, params: SemanticTokensParams) async -> Response<SemanticTokensResponse> {+guard let tokens = await actor.semanticTokens(uri: params.textDocument.uri, in: nil) else { return .success(nil) }+func semanticTokensRange(id: JSONId, params: SemanticTokensRangeParams) async -> Response<SemanticTokensResponse> {+guard let tokens = await actor.semanticTokens(uri: params.textDocument.uri, in: params.range) else { return .success(nil) }+func foldingRange(id: JSONId, params: FoldingRangeParams) async -> Response<FoldingRangeResponse> {+guard let cursor = await actor.cursor(uri: params.textDocument.uri)?.cursor else { return .success(nil) }+guard let cursor = await actor.cursor(uri: params.textDocument.uri)?.cursor else { return .success(nil) }+func inlayHintResolve(id: JSONId, params: InlayHint) async -> Response<InlayHintResponse> { return .success(nil) }+func typeHierarchySupertypes(id: JSONRPC.JSONId, params: TypeHierarchySupertypesParams) async -> Response<TypeHierarchySupertypesResponse> { .success(nil) }+func typeHierarchySubtypes(id: JSONId, params: TypeHierarchySubtypesParams) async -> Response<TypeHierarchySubtypesResponse> { .success(nil) }+func workspaceExecuteCommand(id: JSONId, params: ExecuteCommandParams) async -> Response<LSPAny?> { .success(nil) }+func workspaceWillCreateFiles(id: JSONId, params: CreateFilesParams) async -> Response<WorkspaceEdit?> { .success(nil) }+func workspaceWillRenameFiles(id: JSONId, params: RenameFilesParams) async -> Response<WorkspaceEdit?> { .success(nil) }+func workspaceWillDeleteFiles(id: JSONId, params: DeleteFilesParams) async -> Response<WorkspaceEdit?> { .success(nil) }+func workspaceSymbol(id: JSONId, params: WorkspaceSymbolParams) async -> Response<WorkspaceSymbolResponse> { .success(nil) }+func textDocumentWillSaveWaitUntil(id: JSONId, params: WillSaveTextDocumentParams) async -> Response<[TextEdit]?> { .success(nil) }+func completion(id: JSONId, params: CompletionParams) async -> Response<CompletionResponse> { .success(nil) }+func hover(id: JSONId, params: TextDocumentPositionParams) async -> Response<HoverResponse> { .success(nil) }+func signatureHelp(id: JSONId, params: TextDocumentPositionParams) async -> Response<SignatureHelpResponse> { .success(nil) }+func declaration(id: JSONId, params: TextDocumentPositionParams) async -> Response<DeclarationResponse> { .success(nil) }+func definition(id: JSONId, params: TextDocumentPositionParams) async -> Response<DefinitionResponse> { .success(nil) }+func typeDefinition(id: JSONId, params: TextDocumentPositionParams) async -> Response<TypeDefinitionResponse> { .success(nil) }+func implementation(id: JSONId, params: TextDocumentPositionParams) async -> Response<ImplementationResponse> { .success(nil) }+func documentHighlight(id: JSONId, params: DocumentHighlightParams) async -> Response<DocumentHighlightResponse> { .success(nil) }+func documentSymbol(id: JSONId, params: DocumentSymbolParams) async -> Response<DocumentSymbolResponse> { .success(nil) }+func codeAction(id: JSONId, params: CodeActionParams) async -> Response<CodeActionResponse> { .success(nil) }+func codeLens(id: JSONId, params: CodeLensParams) async -> Response<CodeLensResponse> { .success(nil) }+func selectionRange(id: JSONId, params: SelectionRangeParams) async -> Response<SelectionRangeResponse> { .success(nil) }+func linkedEditingRange(id: JSONId, params: LinkedEditingRangeParams) async -> Response<LinkedEditingRangeResponse> { .success(nil) }+func prepareCallHierarchy(id: JSONId, params: CallHierarchyPrepareParams) async -> Response<CallHierarchyPrepareResponse> { .success(nil) }+func prepareRename(id: JSONId, params: PrepareRenameParams) async -> Response<PrepareRenameResponse> { .success(nil) }+func prepareTypeHeirarchy(id: JSONId, params: TypeHierarchyPrepareParams) async -> Response<PrepareTypeHeirarchyResponse> { .success(nil) }+func rename(id: JSONId, params: RenameParams) async -> Response<RenameResponse> { .success(nil) }+func documentLink(id: JSONId, params: DocumentLinkParams) async -> Response<DocumentLinkResponse> { .success(nil) }+func formatting(id: JSONId, params: DocumentFormattingParams) async -> Response<FormattingResult> { .success(nil) }+func rangeFormatting(id: JSONId, params: DocumentRangeFormattingParams) async -> Response<FormattingResult> { .success(nil) }+func onTypeFormatting(id: JSONId, params: DocumentOnTypeFormattingParams) async -> Response<FormattingResult> { .success(nil) }+func references(id: JSONId, params: ReferenceParams) async -> Response<ReferenceResponse> { .success(nil) }+func moniker(id: JSONId, params: MonikerParams) async -> Response<MonikerResponse> { .success(nil) }+func semanticTokensFullDelta(id: JSONId, params: SemanticTokensDeltaParams) async -> Response<SemanticTokensDeltaResponse> { .success(nil) }+func callHierarchyIncomingCalls(id: JSONId, params: CallHierarchyIncomingCallsParams) async -> Response<CallHierarchyIncomingCallsResponse> { .success(nil) }+func callHierarchyOutgoingCalls(id: JSONId, params: CallHierarchyOutgoingCallsParams) async -> Response<CallHierarchyOutgoingCallsResponse> { .success(nil) }+func custom(id: JSONId, method: String, params: LSPAny) async -> Response<LSPAny> { .success(nil) }
+63
Sources/PterodactylLanguageServer/Logger.swift
+63
Sources/PterodactylLanguageServer/Logger.swift
···
+32
Sources/PterodactylLanguageServer/PterodactylServer.swift
+32
Sources/PterodactylLanguageServer/PterodactylServer.swift
···
+69
Sources/PterodactylLanguageServer/PterodactylServerActor.swift
+69
Sources/PterodactylLanguageServer/PterodactylServerActor.swift
···+self.buildEngine = FXEngine(group: group, db: db, functionCache: functionCache, executor: executor)+if let stored = storedBlobs[uri], let version, let storedVersion = stored.version, storedVersion >= version {+let blobId: LLBDataID = try await casClient.store(LLBByteBuffer(string: text), casContext).get()+let lineMap = try await buildEngine.build(key: Keys.Blob.GetLineMap(blobId: blobId), casContext).get()+let parseResult = try await buildEngine.build(key: Keys.Blob.ParseDocument(blobId: blobId), casContext).get()+let publishParams = PublishDiagnosticsParams(uri: uri, version: version, diagnostics: diagnostics)+let lineMap = try await buildEngine.build(key: Keys.Blob.GetLineMap(blobId: storedBlob.blobId), casContext).get()+let parseResult = try await buildEngine.build(key: Keys.Blob.ParseDocument(blobId: storedBlob.blobId), casContext).get()
-25
Sources/PterodactylSyntax/Cursor.swift
-25
Sources/PterodactylSyntax/Cursor.swift
···
+37
Sources/PterodactylSyntax/Diagnostic.swift
+37
Sources/PterodactylSyntax/Diagnostic.swift
···
+61
Sources/PterodactylSyntax/FoldingRanges.swift
+61
Sources/PterodactylSyntax/FoldingRanges.swift
···+if let foldingRangeKind = node.tree?.metadata?.delimitedFoldingRangeKind, let visibleUtf16Range {+let foldingRange = FoldingRange(startLine: startLocation.line, endLine: endLocation.line, kind: foldingRangeKind)
+110
Sources/PterodactylSyntax/Grammar.swift
+110
Sources/PterodactylSyntax/Grammar.swift
···
+40
Sources/PterodactylSyntax/ImportParser.swift
+40
Sources/PterodactylSyntax/ImportParser.swift
···
+263
Sources/PterodactylSyntax/Lexer.swift
+263
Sources/PterodactylSyntax/Lexer.swift
···
+41
Sources/PterodactylSyntax/LineMap.swift
+41
Sources/PterodactylSyntax/LineMap.swift
···
+269
Sources/PterodactylSyntax/ParseState.swift
+269
Sources/PterodactylSyntax/ParseState.swift
···+mutating func recoverUntil(_ anchors: Set<TokenKind>, expected: [TokenKind], error: String? = nil) {+let message = error ?? "Expected one of \(expected.map(String.init(describing:)).sorted(using: .localized)) but got \(discardTokens)"+mutating func tryToken(kind: TokenKind, metadata: TokenMetadata? = nil) -> ControlFlow<Void> {+func structure(kind: SyntaxTreeKind? = nil, metadata: SyntaxTreeMetadata? = nil) -> SyntaxTreeBuilder.SubtreeHandle {
+287
Sources/PterodactylSyntax/Parser.swift
+287
Sources/PterodactylSyntax/Parser.swift
···+/// This will consume at least one ``TokenKind.blockSep``, possibly also consuming some block items containing only trivia.+var handle = structure(kind: Theory.kind, metadata: SyntaxTreeMetadata(delimitedFoldingRangeKind: .region))
+97
Sources/PterodactylSyntax/SemanticToken.swift
+97
Sources/PterodactylSyntax/SemanticToken.swift
···+public func collectSemanticTokens(_ sink: inout [SemanticToken], in range: Range<Int>? = nil) {
+98
Sources/PterodactylSyntax/SyntaxCursor.swift
+98
Sources/PterodactylSyntax/SyntaxCursor.swift
···+/// This is a โred treeโ in the sense of Roslyn. In essence it instruments syntax trees with non-relative location information.
+36
-9
Sources/PterodactylSyntax/SyntaxTree.swift
+36
-9
Sources/PterodactylSyntax/SyntaxTree.swift
···-public init(kind: SyntaxTreeKind, metadata: SyntaxTreeMetadata?, children: [SyntaxTree.Child]) {+public init(kind: SyntaxTreeKind, metadata: SyntaxTreeMetadata? = nil, children: [SyntaxTree.Child]) {···+/// A mutable version of ``SyntaxTree`` that does not keep track of textual length, for use when constructing trees.
+96
Sources/PterodactylSyntax/SyntaxTreeBuilder.swift
+96
Sources/PterodactylSyntax/SyntaxTreeBuilder.swift
···+init(parent: SyntaxTreeBuilder, kind: SyntaxTreeKind? = nil, metadata: SyntaxTreeMetadata? = nil) {+public func open(kind: SyntaxTreeKind? = nil, metadata: SyntaxTreeMetadata? = nil) -> SubtreeHandle {
+21
Sources/PterodactylSyntax/SyntaxView.swift
+21
Sources/PterodactylSyntax/SyntaxView.swift
···+/// An abstract syntax view around a ``SyntaxCursor``. This is to be populated by extensions targetting specific `G`.
+2
-3
Sources/PterodactylSyntax/Token.swift
+2
-3
Sources/PterodactylSyntax/Token.swift
···
+101
-7
Sources/PterodactylSyntax/Types.swift
+101
-7
Sources/PterodactylSyntax/Types.swift
···
-24
Sources/PterodactylSyntax/Utf16Position.swift
-24
Sources/PterodactylSyntax/Utf16Position.swift
···
+45
-5
Tests/PterodactylBuildTests/Test.swift
+45
-5
Tests/PterodactylBuildTests/Test.swift
···+.keyword(.theory), .whitespace, .identifier, .whitespace, .keyword(.where), .newline, .blockBegin, .whitespace, .identifier, .whitespace,+.whitespace, .identifier, .newline, .newline, .blockSep, .whitespace, .identifier, .whitespace, .punctuation(.colon), .whitespace, .identifier, .blockEnd, .eof+// let cursor = SyntaxCursor(lineMap: LineMap(source: code), node: .tree(tree), utf16Offset: 0)···-let dependencyGraph = try await engine.build(key: Keys.DependencyGraphOfSourceTree(sourceTreeId: treeID), ctx).get()+let dependencyGraph = try await engine.build(key: Keys.SourceTree.GetDependencyGraph(sourceTreeId: treeID), ctx).get()···-let dependenciesOfBaz = try await engine.build(key: Keys.TransitiveDependencies(sourceTreeId: treeID, unitName: baz), ctx).get().dependencies+let dependenciesOfBaz = try await engine.build(key: Keys.SourceTree.GetDependencies(sourceTreeId: treeID, unitName: baz), ctx).get()
+29
Tests/PterodactylLanguageServerTests/Test.swift
+29
Tests/PterodactylLanguageServerTests/Test.swift
···
+4
license.sh
+4
license.sh