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

Add support for Textidote #3066

Closed
wants to merge 3 commits into from
Closed

Conversation

juanolon
Copy link

based on issue #2467 add support for textidote
documentation also updated

@stale
Copy link

stale bot commented Aug 13, 2020

This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See :help ale-dev for information on writing tests.
If your pull request is good to merge, bother w0rp or another maintainer again, and get them to merge it.

@stale stale bot added the stale PRs/Issues no longer valid label Aug 13, 2020
@stale stale bot closed this Aug 15, 2020
@hsanson hsanson reopened this Dec 24, 2020
let l:exe .= ' --check ' . l:check_lang
endif

return l:exe . ' ' . expand('#' . a:buffer . ':t')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work when editing files in sub-foders. For example:

main.tex
chapter1/section01.tex

Removing the ':t' would properly show the textidote reported errors on both the main.tex and the chapter1/section01.tex files.

@stale stale bot removed the stale PRs/Issues no longer valid label Dec 24, 2020
endfunction

function! ale_linters#tex#textidote#Handle(buffer, lines) abort
let l:pattern = '.*' . expand('#' . a:buffer . ':t:r') . '\.tex(L\(\d\+\)C\(\d\+\)-L\d\+C\d\+): \(.*\)".*"'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as previous comment this breaks for subfolder files. Remove the :t to make it work properly.

let l:exe = ale#Var(a:buffer, 'tex_textidote_executable')
let l:exe .= ' ' . ale#Var(a:buffer, 'tex_textidote_options')

let l:check_lang = ale#Var(a:buffer, 'tex_textidote_check_lang')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small attempt to get language from spelllang configuration, may be worth considering:

" Function tries to determine the language to use with textidote from the
" spelllang configuration.
function! ale_linters#tex#textidote#GetSpellLang(buffer) abort

  let l:check_lang = ale#Var(a:buffer, 'tex_textidote_check_lang')

  if !empty(l:check_lang)
    return l:check_lang
  endif

  let l:supported_languages = ['en', 'de', 'es', 'fr', 'nl', 'pt']
  let l:spell_languages = split(&spelllang, ',')

  for spell_lang in l:spell_languages
    for supported_lang in l:supported_languages
      if(spell_lang == supported_lang)
        return spell_lang
      endif
    endfor
  endfor

  return ''
endfunction

Copy link
Contributor

@hsanson hsanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing tests.

@stale
Copy link

stale bot commented Jan 21, 2021

This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See :help ale-dev for information on writing tests.
If your pull request is good to merge, bother w0rp or another maintainer again, and get them to merge it.

@stale stale bot added the stale PRs/Issues no longer valid label Jan 21, 2021
@hsanson
Copy link
Contributor

hsanson commented Jan 22, 2021

ALE migrated from Travis to Github Actions (see #3548) so it is necessary to rebase this PR from latest master branch to trigger the required checks.

# Add dense-analysis as remote upstream on your local fork. Not 
# needed if already added.
git remote add upstream https://github.com/dense-analysis/ale.git

# Sync your local master with upstream master
git checkout master
git fetch upstream master
git merge upstream/master

# Rebase the PR branch with master
git checkout my-branch-name
git rebase master   # Fix any conflicts you may have

# Force push the updated PR branch to origin to trigger the checks
git push -f origin my-branch-name

@stale stale bot removed the stale PRs/Issues no longer valid label Jan 22, 2021
@stale
Copy link

stale bot commented Feb 19, 2021

This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See :help ale-dev for information on writing tests.
If your pull request is good to merge, bother w0rp or another maintainer again, and get them to merge it.

@stale stale bot added the stale PRs/Issues no longer valid label Feb 19, 2021
@stale stale bot closed this Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PRs/Issues no longer valid
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants