Skip to content

Commit

Permalink
cleanup: remove outdated check
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed May 7, 2024
1 parent e54ba06 commit 8074914
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 0 additions & 4 deletions src/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ export function isInitialized (): boolean {
}

export async function initialize (constructionOptions: IWorkbenchConstructionOptions = {}, container?: HTMLElement): Promise<void> {
if (typeof process !== 'undefined') {
console.warn('`process` detected. It may have negative impacts on VSCode behavior')
}

if (constructionOptions.workspaceProvider == null) {
constructionOptions = {
...constructionOptions,
Expand Down
10 changes: 5 additions & 5 deletions src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,16 @@ export function hideCodeWithoutDecoration (editor: monaco.editor.ICodeEditor, de
const selections = editor.getSelections()
if (selections != null) {
const visibleRanges = editor._getViewModel()!.getModelVisibleRanges()
let newSelection = selections.flatMap(selection =>
let newSelections = selections.flatMap(selection =>
visibleRanges.map(visibleRange => selection.intersectRanges(visibleRange))
.filter((range): range is monaco.Range => range != null)
.map(range => monaco.Selection.fromRange(range, selection.getDirection()))
)
if (newSelection.length === 0 && visibleRanges.length > 0) {
newSelection = [monaco.Selection.fromPositions(visibleRanges[0]!.getStartPosition())]
if (newSelections.length === 0 && visibleRanges.length > 0) {
newSelections = [monaco.Selection.fromPositions(visibleRanges[0]!.getStartPosition())]
}
if (newSelection.length > 0) {
editor.setSelections(newSelection)
if (newSelections.length > 0) {
editor.setSelections(newSelections)
}
}
}
Expand Down

0 comments on commit 8074914

Please sign in to comment.