aboutsummaryrefslogtreecommitdiff
path: root/src/server/lens.odin
blob: 5525554a15c83d7b3e50a2a05b1fda3ce35e0667 (plain)
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
package server

import "core:odin/ast"


import "shared:common"


CodeLensClientCapabilities :: struct {
	dynamicRegistration: bool,
}

CodeLensOptions :: struct {
	resolveProvider: bool,
}

CodeLens :: struct {
	range: common.Range,
	command: Command,
	data: string,
}

get_code_lenses :: proc(document: ^Document, position: common.Position) -> ([]CodeLens, bool) {
	ast_context := make_ast_context(document.ast, document.imports, document.package_name, document.uri.uri, document.fullpath)

	get_globals(document.ast, &ast_context)

	symbols := make([dynamic]CodeLens, context.temp_allocator)

	if len(document.ast.decls) == 0 {
		return {}, true
	}

	for name, global in ast_context.globals {

		
		if proc_lit, ok := global.expr.derived.(^ast.Proc_Lit); ok {

			

		}


	}
	

	return {}, false

}