Created
August 18, 2018 03:38
-
-
Save zsytssk/926ad74e990926757fa3c1eb349beb76 to your computer and use it in GitHub Desktop.
Thenable Promise.resolve
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDocumentSettings(resource: string): Thenable<ExampleSettings> { | |
if (!hasConfigurationCapability) { | |
return Promise.resolve(globalSettings); | |
} | |
let result = documentSettings.get(resource); | |
if (!result) { | |
result = connection.workspace.getConfiguration({ | |
scopeUri: resource, | |
section: 'languageServerExample' | |
}); | |
documentSettings.set(resource, result); | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment