Skip to content

Commit

Permalink
Merge pull request #33 from uros-5/nodejs-completion-duplicate
Browse files Browse the repository at this point in the history
fix nodejs completion duplicate
  • Loading branch information
uros-5 authored Nov 22, 2024
2 parents e2f538c + daceb76 commit 6dc60b0
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI-nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
'on':
push:
branches:
- extending-link-hint-literal
- nodejs-completion-duplicate
tags-ignore:
- '**'
paths-ignore:
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/android-arm-eabi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-android-arm-eabi",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"android"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/android-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-android-arm64",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"android"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-darwin-arm64",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/darwin-universal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-darwin-universal",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/freebsd-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-freebsd-x64",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"freebsd"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/linux-arm-gnueabihf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-linux-arm-gnueabihf",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/linux-arm-musleabihf/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-linux-arm-musleabihf",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-linux-arm64-gnu",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-linux-arm64-musl",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/linux-riscv64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-linux-riscv64-gnu",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-linux-x64-gnu",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-linux-x64-musl",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/win32-arm64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-win32-arm64-msvc",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"win32"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/win32-ia32-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-win32-ia32-msvc",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"win32"
],
Expand Down
2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions-win32-x64-msvc",
"version": "0.0.21",
"version": "0.0.22",
"os": [
"win32"
],
Expand Down
4 changes: 2 additions & 2 deletions jinja-lsp-nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jinja-lsp-nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jinja-lsp/functions",
"version": "0.0.21",
"version": "0.0.22",
"main": "index.js",
"types": "index.d.ts",
"napi": {
Expand Down
7 changes: 4 additions & 3 deletions jinja-lsp-nodejs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl NodejsLspFiles {
}
self.actions.insert(uri.to_string(), actions);
self.action_objects.insert(uri.to_string(), action_objects);
self.lsp_files.variables.insert(uri, identifiers);
// self.lsp_files.variables.insert(uri, identifiers);
}
}

Expand Down Expand Up @@ -302,7 +302,7 @@ impl NodejsLspFiles {
let value = data_type.completion_detail().to_owned();
let value = format!("{value}\n\n---\n**{}**", &full_name);
let actions = vec![];
let actions = self.actions.get(&filename).unwrap_or(&actions);
let actions = self.actions.get("temp").unwrap_or(&actions);
let action = Action {
name: full_name.to_owned(),
description: value.to_owned(),
Expand Down Expand Up @@ -389,7 +389,8 @@ impl NodejsLspFiles {

CompletionType::Identifier => {
let empty = vec![];
let actions = self.actions.get("temp").unwrap_or(&empty);
let actions = self.actions.get("temp_").unwrap_or(&empty);

if let Some(variables) = self.lsp_files.read_variables(&uri, position, None, None) {
let mut ret = vec![];
for item in actions {
Expand Down

0 comments on commit 6dc60b0

Please sign in to comment.