diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-06-21 23:20:08 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-06-21 23:20:08 +0200 |
| commit | 9e9f4958f0ff2686cd0ace5a247c54c5ab775106 (patch) | |
| tree | 16c380c917b9854d123cabc88506a817a487cb8e /src/server | |
| parent | c49992c8b71f9afa9acdf3ae86d6a9a3dacce719 (diff) | |
clean up
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/build.odin | 1 | ||||
| -rw-r--r-- | src/server/indexer.odin | 31 |
2 files changed, 1 insertions, 31 deletions
diff --git a/src/server/build.odin b/src/server/build.odin index 0aefaf1..94bc4f3 100644 --- a/src/server/build.odin +++ b/src/server/build.odin @@ -29,7 +29,6 @@ platform_os: map[string]bool = { "wasm32" = true, } - os_enum_to_string: map[runtime.Odin_OS_Type]string = { .Windows = "windows", .Darwin = "darwin", diff --git a/src/server/indexer.odin b/src/server/indexer.odin index 85e6613..095dd60 100644 --- a/src/server/indexer.odin +++ b/src/server/indexer.odin @@ -6,39 +6,10 @@ import "core:strings" import "core:log" import "core:sort" -/* - Concept ideas: - - static indexing: - - is responsible for implementing the indexing of symbols for static files. - - This is to solve the scaling problem of large projects with many files and symbols, as most of these files will be static. - - Possible scopes for static files: - global scope (we don't have hiarachy of namespaces and therefore only need to look at the global scope) - - Scopes not part of the indexer: - function scope, file scope, package scope(these are only relevant for dynamic active files in your project, that use the ast instead of indexing) - - Potential features: - Allow for saving the indexer, instead of recreating it everytime the lsp starts(but you would have to account for stale data). - - - dynamic indexing: - - When the user modifies files we need some smaller index to handle everything the user is using right now. This will allow - us to rebuild parts of the index without too much of a performance hit. - - This index is first searched and if nothing is found look in the static index. -*/ - - Indexer :: struct { builtin_packages: [dynamic]string, index: MemoryIndex, - dynamic_uri_owned: map[string]bool, } indexer: Indexer @@ -49,7 +20,7 @@ FuzzyResult :: struct { } lookup :: proc(name: string, pkg: string, loc := #caller_location) -> (Symbol, bool) { - if symbol, ok := memory_index_lookup(&indexer.index, name, pkg); ok && symbol.uri not_in indexer.dynamic_uri_owned { + if symbol, ok := memory_index_lookup(&indexer.index, name, pkg); ok { log.infof("lookup name: %v pkg: %v, symbol %v location %v", name, pkg, symbol, loc) return symbol, true } |