// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { Uri } from 'coc.nvim' import { Event } from 'vscode-languageserver-protocol' export type EnvironmentVariables = Object & Record export const IEnvironmentVariablesService = Symbol('IEnvironmentVariablesService') export interface IEnvironmentVariablesService { parseFile(filePath?: string, baseVars?: EnvironmentVariables): Promise mergeVariables(source: EnvironmentVariables, target: EnvironmentVariables): void appendPythonPath(vars: EnvironmentVariables, ...pythonPaths: string[]): void appendPath(vars: EnvironmentVariables, ...paths: string[]): void } /** * An interface for a JavaScript object that * acts as a dictionary. The keys are strings. */ export interface IStringDictionary { [name: string]: V } export interface ISystemVariables { resolve(value: string): string resolve(value: string[]): string[] resolve(value: IStringDictionary): IStringDictionary resolve(value: IStringDictionary): IStringDictionary resolve(value: IStringDictionary>): IStringDictionary> resolveAny(value: T): T // tslint:disable-next-line:no-any [key: string]: any } export const IEnvironmentVariablesProvider = Symbol('IEnvironmentVariablesProvider') export interface IEnvironmentVariablesProvider { onDidEnvironmentVariablesChange: Event getEnvironmentVariables(resource?: Uri): Promise }