-
Notifications
You must be signed in to change notification settings - Fork 4
/
AcceleoLanguageServerContext.java
64 lines (56 loc) · 2.31 KB
/
AcceleoLanguageServerContext.java
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
55
56
57
58
59
60
61
62
63
64
/*******************************************************************************
* Copyright (c) 2020, 2023 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.acceleo.aql.ls;
import java.net.URI;
import org.eclipse.acceleo.aql.ls.services.workspace.AcceleoProject;
import org.eclipse.acceleo.aql.ls.services.workspace.AcceleoWorkspace;
import org.eclipse.acceleo.query.runtime.namespace.workspace.IQueryWorkspaceQualifiedNameResolver;
/**
* The context of the {@link AcceleoLanguageServer} provided by the runtime that hosts the server. It is used
* for the integration of the Acceleo editor features into the host IDE.<br/>
* <br/>
* FIXME: note that the services brought by this API should instead be implemented as extensions to the LSP
* protocol. Currently, an Acceleo LS assumes its creator also is able to provide information about the
* client, essentially binding the server with a particular client.
*
* @author Florent Latombe
*/
public interface AcceleoLanguageServerContext {
/**
* Creates an {@link AcceleoWorkspace}.
*
* @return the newly-created {@link AcceleoWorkspace}.
*/
AcceleoWorkspace createWorkspace();
/**
* Called when the owner {@link AcceleoLanguageServer} shutdowns.
*
* @param workspaceToDelete
* the (non-{@code null}) {@link AcceleoWorkspace} to delete.
*/
void deleteWorkspace(AcceleoWorkspace workspaceToDelete);
/**
* Gets the contents of the given resource {@link URI}.
*
* @param resource
* the resource {@link URI}
* @return the contents of the given resource {@link URI}
*/
String getResourceContents(URI resource);
/**
* Creates the {@link IQueryWorkspaceQualifiedNameResolver} for the given {@link AcceleoProject}.
*
* @param project
* the {@link AcceleoProject}
* @return the created {@link IQueryWorkspaceQualifiedNameResolver} for the given {@link AcceleoProject}
*/
IQueryWorkspaceQualifiedNameResolver createResolver(AcceleoProject project);
}