Skip to content

Commit 3bf5e55

Browse files
authored
fixed hover for not valid file (#28)
1 parent 307b78c commit 3bf5e55

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to the "bitloops-language" extension will be documented in t
44

55
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
66

7+
### 0.4.3
8+
9+
Fixed bug of hover for file not valid location.
10+
711
### 0.4.2
812

913
Update transpiler package.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ No known issues.
3333

3434
## What's New
3535

36-
### 0.4.1
36+
### 0.4.3
3737

38-
Fixed bug of hover for multiple files workspace
38+
Fixed bug of hover for file not valid location.
3939

4040
---
4141

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"icon": "assets/images/bitloops-language-logo-256x256.png",
1111
"license": "MIT",
12-
"version": "0.4.2",
12+
"version": "0.4.3",
1313
"scripts": {
1414
"vs:package": "vsce package",
1515
"vs:publish": "vsce publish",

server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bitloops-lsp-server",
33
"description": "BitLoops Language Server",
4-
"version": "0.4.1",
4+
"version": "0.4.3",
55
"publisher": "Bitloops",
66
"license": "MIT",
77
"engines": {

server/src/lsp/handlers/hover-handler/hover.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ export const handleHover = (
88
stateManager: StateManager,
99
analyzer: IAnalyzer,
1010
params: HoverParams,
11-
): Hover => {
11+
): Hover | null => {
1212
const fileContent = stateManager.getFileContent(params.textDocument.uri);
1313
const document = TextDocument.create(params.textDocument.uri, 'bitloops', 1, fileContent);
1414
const position = params.position;
1515
const boundedContext = stateManager.getBoundedContext(params.textDocument.uri);
1616

1717
let word = findWord(document, position);
1818
const symbolTable = analyzer.getSymbolTable() as TSymbolTableSemantics;
19+
if (!symbolTable) return null;
1920
const testSymbolTable = symbolTable.symbolTables[boundedContext];
2021
const typeOfKeyword = testSymbolTable?.findTypeOfKeyword(word, {
2122
line: position.line,

0 commit comments

Comments
 (0)