summaryrefslogtreecommitdiff
path: root/src/server/lens.odin
blob: 964f6cff7312e7f7f0ef21d8af2594f90aed04ea (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
51
52
53
54
package server

import "core:odin/ast"


import "src: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

}