How to use the vscode-languageserver-types.Position function in vscode-languageserver-types

To help you get started, we’ve selected a few vscode-languageserver-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github onivim / oni / browser / src / Services / Learning / Tutorial / Tutorials.tsx View on Github external
public render(context: Oni.BufferLayerRenderContext): JSX.Element {
        // const anyContext = context as any
        const screenPosition = context.bufferToScreen(
            types.Position.create(this._line, this._column),
        )
        const pixelPosition = context.screenToPixel(screenPosition)

        return (
            
        )
    }
}
github onivim / oni / browser / src / Services / Learning / Tutorial / Stages / CorrectLineStage.tsx View on Github external
public render(context: Oni.BufferLayerRenderContext): JSX.Element {
        // const anyContext = context as any
        const screenPosition = context.bufferToScreen(
            types.Position.create(this._line, this._diffPosition),
        )

        const pixelPosition = context.screenToPixel(screenPosition)

        if (pixelPosition.pixelX < 0 || pixelPosition.pixelY < 0) {
            return null
        }

        return (
            <div style="{{"></div>
github codesandbox / codesandbox-client / standalone-packages / vscode-extensions / out / extensions / jpoissonnier.vscode-styled-components-0.0.26 / node_modules / vscode-css-languageservice / lib / umd / cssLanguageTypes.js View on Github external
})(function (require, exports) {
    /*---------------------------------------------------------------------------------------------
     *  Copyright (c) Microsoft Corporation. All rights reserved.
     *  Licensed under the MIT License. See License.txt in the project root for license information.
     *--------------------------------------------------------------------------------------------*/
    'use strict';
    Object.defineProperty(exports, "__esModule", { value: true });
    var vscode_languageserver_types_1 = require("vscode-languageserver-types");
    exports.Range = vscode_languageserver_types_1.Range;
    exports.TextEdit = vscode_languageserver_types_1.TextEdit;
    exports.Position = vscode_languageserver_types_1.Position;
});
//# sourceMappingURL=cssLanguageTypes.js.map
github onivim / oni / browser / src / UI / components / Error.tsx View on Github external
const markers = errors.map((e) =&gt; {

            const screenSpaceStart = this.props.bufferToScreen(types.Position.create(e.range.start.line, e.range.start.character))
            if (!screenSpaceStart) {
                return null
            }

            const screenLine = screenSpaceStart.screenY

            const screenY = screenLine
            const pixelPosition = this.props.screenToPixel({screenX: 0, screenY })
            const isActive = this.props.cursorLine - 1 === e.range.start.line
            const pixelY = pixelPosition.pixelY - (padding / 2)

            return 
        })
github onivim / oni / browser / src / Editor / NeovimEditor / containers / DefinitionContainer.ts View on Github external
import { connect } from "react-redux"

import * as types from "vscode-languageserver-types"

import { Definition, IDefinitionProps } from "./../../../UI/components/Definition"

import * as Selectors from "./../NeovimEditorSelectors"
import * as State from "./../NeovimEditorStore"

const emptyRange = types.Range.create(
    types.Position.create(-1, -1),
    types.Position.create(-1, -1),
)

const getActiveDefinition = (state: State.IState) => state.definition

const mapStateToProps = (state: State.IState): IDefinitionProps => {

    const window = Selectors.getActiveWindow(state)

    const noop = (): any => null

    const activeDefinition = getActiveDefinition(state)

    const range = activeDefinition ? activeDefinition.token.range : emptyRange

    return {
github onivim / oni / browser / src / Services / Completion / CompletionStore.ts View on Github external
const token = languageManager.getTokenRegex(bufferInfo.language)
            const completionCharacters = languageManager.getCompletionTriggerCharacters(
                bufferInfo.language,
            )

            const meet = CompletionUtility.getCompletionMeet(
                currentState.cursorInfo.lineContents,
                currentState.cursorInfo.column,
                token,
                completionCharacters,
            )

            const highlightInfo = syntaxHighlighter.getHighlightTokenAt(
                currentState.bufferInfo.bufferId,
                types.Position.create(currentState.cursorInfo.line, meet.positionToQuery),
            )
            const scopes = highlightInfo && highlightInfo.scopes ? highlightInfo.scopes : []

            const meetForAction: ICompletionMeetInfo = {
                meetPosition: meet.position,
                meetLine: currentState.cursorInfo.line,
                queryPosition: meet.positionToQuery,
                meetBase: meet.base,
                shouldExpand: meet.shouldExpandCompletions,
                textMateScopes: scopes,
            }

            return {
                type: "MEET_CHANGED",
                currentMeet: meetForAction,
            } as CompletionAction
github onivim / oni / vim / core / oni-plugin-typescript / src / FindAllReferences.ts View on Github external
const mapResponseToLocation = (
        referenceItem: protocol.ReferencesResponseItem,
    ): types.Location => {
        const startPosition = types.Position.create(
            referenceItem.start.line - 1,
            referenceItem.start.offset - 1,
        )
        const endPosition = types.Position.create(
            referenceItem.end.line - 1,
            referenceItem.end.offset - 1,
        )
        const range = types.Range.create(startPosition, endPosition)

        return {
            uri: oni.language.wrapPathInFileUri(referenceItem.file),
            range,
        }
    }
github onivim / oni / browser / src / Services / Learning / Tutorial / Stages / FadeInLineStage.tsx View on Github external
public render(context: Oni.BufferLayerRenderContext): JSX.Element {
        const screenPosition = context.bufferToScreen(types.Position.create(0, 0))
        const pixelPosition = context.screenToPixel(screenPosition)

        if (pixelPosition.pixelX &lt; 0 || pixelPosition.pixelY &lt; 0) {
            return null
        }

        const height = (context as any).fontPixelHeight

        return (
github onivim / oni / browser / src / Editor / NeovimEditor / containers / DefinitionContainer.ts View on Github external
import { connect } from "react-redux"

import * as types from "vscode-languageserver-types"

import { Definition, IDefinitionProps } from "./../../../UI/components/Definition"

import * as Selectors from "./../NeovimEditorSelectors"
import * as State from "./../NeovimEditorStore"

const emptyRange = types.Range.create(
    types.Position.create(-1, -1),
    types.Position.create(-1, -1),
)

const getActiveDefinition = (state: State.IState) => state.definition

const mapStateToProps = (state: State.IState): IDefinitionProps => {

    const window = Selectors.getActiveWindow(state)

    const noop = (): any => null

    const activeDefinition = getActiveDefinition(state)

    const range = activeDefinition ? activeDefinition.token.range : emptyRange

    return {
        color: state.colors["editor.foreground"],
github microsoft / BotFramework-Composer / Composer / packages / tools / language-servers / lg-language-server / lib / server.js View on Github external
lgDiags.forEach(diag => {
      let diagnostic = {
        severity: utils_1.convertSeverity(diag.Severity),
        range: {
          start: vscode_languageserver_types_1.Position.create(diag.Range.Start.Line - 1, diag.Range.Start.Character),
          end: vscode_languageserver_types_1.Position.create(diag.Range.End.Line - 1, diag.Range.End.Character),
        },
        message: diag.Message,
        source: document.uri,
      };
      diagnostics.push(diagnostic);
    });
    this.sendDiagnostics(document, diagnostics);