"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NewSymbolNamesAdapter = void 0;
const tslib_1 = require("tslib");
const Converter = tslib_1.__importStar(require("../../../../common/vscode/converter"));
class NewSymbolNamesAdapter {
    constructor(provider, documents) {
        this.provider = provider;
        this.documents = documents;
    }
    async provideNewSymbolNames(resource, range, triggerKind, token) {
        const document = this.documents.getDocumentData(resource);
        if (!document) {
            return Promise.reject(new Error(`There is no document for ${resource}`));
        }
        const doc = document.document;
        const rng = Converter.Range.to(range);
        const result = await this.provider.provideNewSymbolNames(doc, rng, triggerKind, token);
        if (result) {
            return result;
        }
    }
}
exports.NewSymbolNamesAdapter = NewSymbolNamesAdapter;
//# sourceMappingURL=new-symbol-names.js.map