initial re-work of async behavior of language server, looking at the text document service first

This commit is contained in:
Martin Lippert
2021-02-06 08:49:05 +01:00
parent 6e0bb81cbe
commit 8238c1dc90
26 changed files with 463 additions and 450 deletions

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2020 Pivotal, Inc.
* Copyright (c) 2017, 2021 Pivotal, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -75,8 +75,9 @@ public class BoshDefintionFinder extends SimpleDefinitionFinder {
@Override
public List<LocationLink> handle(DefinitionParams params) {
try {
TextDocument doc = server.getTextDocumentService().get(params.getTextDocument().getUri());
if (doc!=null) {
TextDocument doc = server.getTextDocumentService().getLatestSnapshot(params);
if (doc != null) {
YamlFileAST ast = asts.getSafeAst(doc, false);
if (ast!=null) {
Node refNode = ast.findNode(doc.toOffset(params.getPosition()));