Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 (
)
}
}
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>
})(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
const markers = errors.map((e) => {
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
})
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 {
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
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,
}
}
public render(context: Oni.BufferLayerRenderContext): JSX.Element {
const screenPosition = context.bufferToScreen(types.Position.create(0, 0))
const pixelPosition = context.screenToPixel(screenPosition)
if (pixelPosition.pixelX < 0 || pixelPosition.pixelY < 0) {
return null
}
const height = (context as any).fontPixelHeight
return (
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"],
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);