mirror of
https://github.com/Nexoniarz/Finch.git
synced 2026-11-03 16:54:25 +00:00
CI: point LLVM's DIA SDK at the installed Visual Studio; semantic index for the language server
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
84cbbb3e16
commit
ae363b1fa3
10 changed files with 268 additions and 12 deletions
39
src/index.h
Normal file
39
src/index.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
// What the compiler learns about a program while checking it, for the language server:
|
||||
// what each name is, its type, and where it was defined.
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct SymRef { // a name in the source
|
||||
int file, line, col, len;
|
||||
std::string hover; // markdown shown on mouse-over
|
||||
int defFile = -1, defLine = 0, defCol = 0;
|
||||
};
|
||||
|
||||
struct VarInfo { // a variable or parameter, for completion
|
||||
std::string name, type;
|
||||
int file, line, col;
|
||||
int fnFile, fnLine, fnEnd; // the function it lives in
|
||||
};
|
||||
|
||||
struct FnInfo {
|
||||
std::string module, name, signature, doc;
|
||||
std::vector<std::string> params;
|
||||
int file, line, col, endLine;
|
||||
};
|
||||
|
||||
struct StructIndex {
|
||||
std::string module, name;
|
||||
std::vector<std::pair<std::string, std::string>> fields; // name, type
|
||||
int file, line, col;
|
||||
};
|
||||
|
||||
struct SemIndex {
|
||||
std::vector<SymRef> refs;
|
||||
std::vector<VarInfo> vars;
|
||||
std::vector<FnInfo> fns;
|
||||
std::vector<StructIndex> structs;
|
||||
};
|
||||
|
||||
inline SemIndex *g_index = nullptr; // set by the language server; null when compiling
|
||||
Loading…
Reference in a new issue