Skip to content

Commit

Permalink
Rename to completionlib
Browse files Browse the repository at this point in the history
  • Loading branch information
tamuratak committed Sep 10, 2023
1 parent e315856 commit bde236f
Show file tree
Hide file tree
Showing 33 changed files with 50 additions and 41 deletions.
4 changes: 2 additions & 2 deletions src/components/completionupdaterlib/citationupdater.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as vscode from 'vscode'
import {CiteSuggestion, Fields} from '../../providers/completer/citation'
import {CiteSuggestion, Fields} from '../../providers/completionlib/citation'
import type { Logger } from '../logger'
import type { Manager } from '../manager'
import { ReferenceKind } from '../../providers/completer/completionkind'
import { ReferenceKind } from '../../providers/completionlib/completionkind'


export class CitationUpdater {
Expand Down
2 changes: 1 addition & 1 deletion src/components/completionupdaterlib/commandupdater.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {latexParser} from 'latex-utensils'

import { CommandNameDuplicationDetector } from '../../providers/completer/commandlib/commandlib'
import { CommandNameDuplicationDetector } from '../../providers/completionlib/commandlib/commandlib'
import { CommandFinder } from './commandupdaterlib/commandfinder'
import type { Completer } from '../../providers/completion'
import type { Manager } from '../manager'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as vscode from 'vscode'
import { latexParser } from 'latex-utensils'
import { CmdEnvSuggestion } from '../../../providers/completer/command'
import { CommandNameDuplicationDetector, CommandSignatureDuplicationDetector, isTriggerSuggestNeeded } from '../../../providers/completer/commandlib/commandlib'
import { CmdEnvSuggestion } from '../../../providers/completionlib/command'
import { CommandNameDuplicationDetector, CommandSignatureDuplicationDetector, isTriggerSuggestNeeded } from '../../../providers/completionlib/commandlib/commandlib'
import { Completer } from '../../../providers/completion'
import { Manager } from '../../manager'
import { CommandKind } from '../../../providers/completer/completionkind'
import { CommandKind } from '../../../providers/completionlib/completionkind'


export class CommandFinder {
Expand Down
4 changes: 2 additions & 2 deletions src/components/completionupdaterlib/environmentupdater.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {latexParser} from 'latex-utensils'
import {CmdEnvSuggestion} from '../../providers/completer/command'
import {CmdEnvSuggestion} from '../../providers/completionlib/command'
import type { Manager } from '../manager'
import { EnvKind } from '../../providers/completer/completionkind'
import { EnvKind } from '../../providers/completionlib/completionkind'


export class EnvironmentUpdater {
Expand Down
4 changes: 2 additions & 2 deletions src/components/completionupdaterlib/glossaryupdater.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {latexParser} from 'latex-utensils'

import {GlossarySuggestion, GlossaryType} from '../../providers/completer/glossary'
import {GlossarySuggestion, GlossaryType} from '../../providers/completionlib/glossary'
import { toVscodePosition } from '../../utils/utensils'
import { Manager } from '../manager'
import { ReferenceKind } from '../../providers/completer/completionkind'
import { ReferenceKind } from '../../providers/completionlib/completionkind'

interface GlossaryEntry {
readonly label: string | undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as vscode from 'vscode'
import {latexParser} from 'latex-utensils'
import {isNewCommand} from '../../utils/utils'

import { LabelDefinitionElement } from '../../providers/completer/labeldefinition'
import { LabelDefinitionElement } from '../../providers/completionlib/labeldefinition'
import { toVscodeRange } from '../../utils/utensils'
import type { Manager } from '../manager'

Expand Down
8 changes: 4 additions & 4 deletions src/components/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import * as utils from '../utils/utils'
import {InputFileRegExp} from '../utils/inputfilepath'
import { isCacheLatest } from '../utils/utils'

import type {CmdEnvSuggestion} from '../providers/completer/command'
import type {CiteSuggestion} from '../providers/completer/citation'
import type {GlossarySuggestion} from '../providers/completer/glossary'
import type {CmdEnvSuggestion} from '../providers/completionlib/command'
import type {CiteSuggestion} from '../providers/completionlib/citation'
import type {GlossarySuggestion} from '../providers/completionlib/glossary'

import {PdfWatcher} from './managerlib/pdfwatcher'
import {BibWatcher} from './managerlib/bibwatcher'
import {FinderUtils} from './managerlib/finderutils'
import {PathUtils} from './managerlib/pathutils'

import { LabelDefinitionElement } from '../providers/completer/labeldefinition'
import { LabelDefinitionElement } from '../providers/completionlib/labeldefinition'
import { existsPath, isLocalLatexDocument, isVirtualUri, readFileGracefully, readFilePath, statPath } from '../lib/lwfs/lwfs'
import { ExternalPromise } from '../utils/externalpromise'
import { MutexWithSizedQueue } from '../utils/mutexwithsizedqueue'
Expand Down
2 changes: 1 addition & 1 deletion src/components/mathpreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as vscode from 'vscode'

import {MathJaxPool} from './mathpreviewlib/mathjaxpool'
import * as utils from '../utils/svg'
import type {LabelDefinitionEntry} from '../providers/completer/labeldefinition'
import type {LabelDefinitionEntry} from '../providers/completionlib/labeldefinition'
import {getCurrentThemeLightness} from '../utils/theme'

import {CursorRenderer} from './mathpreviewlib/cursorrenderer'
Expand Down
2 changes: 1 addition & 1 deletion src/components/mathpreviewlib/hoverpreviewonref.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as vscode from 'vscode'
import * as utils from '../../utils/svg'
import type {MathJaxPool} from './mathjaxpool'
import type {LabelDefinitionEntry} from '../../providers/completer/labeldefinition'
import type {LabelDefinitionEntry} from '../../providers/completionlib/labeldefinition'
import type {TexMathEnv} from './texmathenvfinder'
import type {MathPreviewUtils} from './mathpreviewutils'
import type { Logger } from '../logger'
Expand Down
2 changes: 1 addition & 1 deletion src/components/mathpreviewlib/texmathenvfinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as vscode from 'vscode'

import * as utils from '../../utils/utils'
import { type ITextDocumentLike, TextDocumentLike } from './textdocumentlike'
import type { LabelDefinitionEntry } from '../../providers/completer/labeldefinition'
import type { LabelDefinitionEntry } from '../../providers/completionlib/labeldefinition'

export type TexMathEnv = {
readonly texString: string,
Expand Down
4 changes: 2 additions & 2 deletions src/providers/atsuggestionlib/atsuggestion.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as vscode from 'vscode'

import type { IProvider } from '../completer/interface'
import type { IProvider } from '../completionlib/interface'
import { escapeRegExp } from '../../utils/utils'
import { readFilePath } from '../../lib/lwfs/lwfs'
import { CommandKind } from '../completer/completionkind'
import { CommandKind } from '../completionlib/completionkind'


export interface AtSuggestionItemEntry {
Expand Down
2 changes: 1 addition & 1 deletion src/providers/bibtexcompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { readFilePath } from '../lib/lwfs/lwfs'
import { hasBibtexId } from '../utils/hastexid'
import type { Logger } from '../components/logger'
import type { Manager } from '../components/manager'
import { BibtexSnippetKind } from './completer/completionkind'
import { BibtexSnippetKind } from './completionlib/completionkind'


type DataBibtexJsonType = typeof import('../../data/bibtex-entries.json')
Expand Down
47 changes: 28 additions & 19 deletions src/providers/completion.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import * as vscode from 'vscode'
import { latexParser } from 'latex-utensils'

import type {IContexAwareProvider, IProvider} from './completer/interface'
import {Citation} from './completer/citation'
import {DocumentClass} from './completer/documentclass'
import {Command} from './completer/command'
import type {CmdItemEntry} from './completer/command'
import {Environment} from './completer/environment'
import type {EnvItemEntry} from './completer/environment'
import {LabelDefinition} from './completer/labeldefinition'
import {Package} from './completer/package'
import {Input, Import, SubImport} from './completer/input'
import {Glossary} from './completer/glossary'
import type { IContexAwareProvider, IProvider } from './completionlib/interface'
import { Citation } from './completionlib/citation'
import { DocumentClass } from './completionlib/documentclass'
import { Command } from './completionlib/command'
import type { CmdItemEntry } from './completionlib/command'
import { Environment } from './completionlib/environment'
import type { EnvItemEntry } from './completionlib/environment'
import { LabelDefinition } from './completionlib/labeldefinition'
import { Package } from './completionlib/package'
import { Input, Import, SubImport } from './completionlib/input'
import { Glossary } from './completionlib/glossary'
import { readFilePath } from '../lib/lwfs/lwfs'
import { BracketReplacer } from './completer/bracketreplacer'
import { CommandRemover } from './completer/commandremover'
import { CommandReplacer } from './completer/commandreplacer'
import { EnvCloser } from './completer/envcloser'
import { EnvRename } from './completer/envrename'
import { CommandAdder } from './completer/commandadder'
import { BracketReplacer } from './completionlib/bracketreplacer'
import { CommandRemover } from './completionlib/commandremover'
import { CommandReplacer } from './completionlib/commandreplacer'
import { EnvCloser } from './completionlib/envcloser'
import { EnvRename } from './completionlib/envrename'
import { CommandAdder } from './completionlib/commandadder'
import type { LatexAstManager } from '../components/astmanager'
import type { GraphicsPreview } from '../components/graphicspreview'
import type { MathPreview } from '../components/mathpreview'
import { FileKind, ReferenceKind } from './completer/completionkind'
import { FileKind, ReferenceKind } from './completionlib/completionkind'


type DataEnvsJsonType = typeof import('../../data/environments.json')
Expand Down Expand Up @@ -208,7 +208,16 @@ export class Completer implements vscode.CompletionItemProvider {
}
}

private async completion(type: CompletionType, line: string, args: {document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, context: vscode.CompletionContext}) {
private async completion(
type: CompletionType,
line: string,
args: {
document: vscode.TextDocument,
position: vscode.Position,
token: vscode.CancellationToken,
context: vscode.CompletionContext
}
) {
let reg: RegExp | undefined
let provider: IProvider | undefined
switch (type) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {runUnitTestWithFixture} from '../../../../utils/ciutils'
import {isTriggerSuggestNeeded} from '../../../../../src/providers/completer/commandlib/commandlib'
import {isTriggerSuggestNeeded} from '../../../../../src/providers/completionlib/commandlib/commandlib'
import assert from 'assert'


Expand Down

0 comments on commit bde236f

Please sign in to comment.