Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏗 Split CompletionItemProvider into smaller modules #905

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Commits on Feb 19, 2021

  1. New imagePathCompletion function

    Code is just moved from the the main completion function. No functional changes
    
    Function is async and has a Cancellation token, though the later could likely be better made use of.
    
    I've  duplicated the lineTextBefore variable within the function rather than passing it in. This is less efficient just now but I think it will be cleaner once all completion functions are separated out. Eventually I don't think it will be needed within the function at all.
    gavbarnett authored and Lemmingh committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    1062d75 View commit details
    Browse the repository at this point in the history
  2. New referenceLinkLabelCompletion functions

    code is just moved from main completion function.
    
    No functional changes.
    gavbarnett authored and Lemmingh committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    f0b03cf View commit details
    Browse the repository at this point in the history
  3. New anchorFromHeadingCompletion function

    Just moved code from main completion function.
    
    No functional changes.
    lineAfterTest variable also moved in to this function as it is the only place it is used.
    gavbarnett authored and Lemmingh committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    f5f7c9d View commit details
    Browse the repository at this point in the history
  4. New filePathsCompletion function

    Code just moved from main function
    
    No functional changes.
    gavbarnett authored and Lemmingh committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    df45756 View commit details
    Browse the repository at this point in the history
  5. Removing whitespace in code

    No functional changes, just tidying code.
    gavbarnett authored and Lemmingh committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    2544a23 View commit details
    Browse the repository at this point in the history
  6. New mathCompletion function

    required renaming of previous `mathCompletion` variable to `mathCompletionItems`
    
    Just moving code from main to new function. No functional change.
    
    Consider moving `mathCompletionItems` into new function in future
    gavbarnett authored and Lemmingh committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    214d6bb View commit details
    Browse the repository at this point in the history
  7. Format code

    Lemmingh committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    8816c1d View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2021

  1. Move LaTeX commands to a new file

    Naming needs further discussion.
    Lemmingh committed Feb 21, 2021
    Configuration menu
    Copy the full SHA
    c21becd View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2021

  1. Better defining matches variable

    Matches is type string array,
    
    The line `matches = lineTextBefore.match(/\\+$/);` seems to be old code and is not doing anything of use. It is repeated a few lines further down in the if statement for maths completion.
    gavbarnett committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    f66c5dc View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2021

  1. Separating Regex to matchRegex variable

    Using named key-value pair for code clarity.
    gavbarnett committed Feb 24, 2021
    Configuration menu
    Copy the full SHA
    a82524e View commit details
    Browse the repository at this point in the history
  2. Better latex regex for completion

    Previous capture relied on counting number of backslashes after matching a regex and performing modular arithmetic to check for an odd number.
    
    This commit is to change the latexCmd regex to a single line which says:
    `/(^|[^\\])([\\]{2})*\\$/`
    
    ```
    IF ( ( (on new line) OR (following a non-backslash char) )
       AND (0 or more pairs of backslashes)
       AND a single backslash )
    THEN there are an odd number of backslashes.
    ```
    
    The benefit of this is to better align with the other regex's used in the if-else statement. also removes need for `matches` variable.
    gavbarnett committed Feb 24, 2021
    Configuration menu
    Copy the full SHA
    43ab0ea View commit details
    Browse the repository at this point in the history