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

Fixes a number of bugs, including issue #55 #56

Merged
merged 4 commits into from
Dec 27, 2024

Conversation

dylon
Copy link
Collaborator

@dylon dylon commented Dec 27, 2024

Changes:

  • Addresses issue Lookup symbols across modules does not work #55 by jumping to symbol definitions in external documents.
  • Resolves the canonical paths of includes.
  • Corrects off-by-one errors on changes to the line numbers from lfortran.
  • Adds support for matching completions against all symbols in the document.
  • Corrects the completion kinds by mapping them from type SymbolKind to type CompletionItemKind.
  • Corrects the mtime type of FileCacheEntry to Date; resolves file paths while extracting definitions.
  • Corrects highlighting and query extraction logic by matching against type strings in additional to symbol literals.
  • Depends on lfortran when extracting hover previews.
  • Removes LFortranLanguageServer.renameSymbol since it has been deprecated and replaced with the analogous method of LFortranCLIAccessor.
  • Corrects unit and integration tests for latest changes.

To understand the changes to text highlighting and query extraction, consider global.f90 from the SNAP repo:

!-----------------------------------------------------------------------
!
! MODULE: global_module
!> @brief
!> Global variables for data types, file names and unit numbers, and
!> commonly used numbers
!
!-----------------------------------------------------------------------

MODULE global_module

  IMPLICIT NONE

  PUBLIC

  SAVE
!_______________________________________________________________________
!
! Numerical kinds.
!_______________________________________________________________________

  INTEGER, PARAMETER :: l_knd = KIND( .TRUE. )
  INTEGER, PARAMETER :: i_knd = SELECTED_INT_KIND( 8 )
  INTEGER, PARAMETER :: r_knd = SELECTED_REAL_KIND( 13 )
!_______________________________________________________________________
!
! File names and unit numbers.
!
! ifile       - input file name
! iunit       - input file unit number
! ofile       - output file name
! ounit       - output file unit number
!_______________________________________________________________________

  CHARACTER(LEN=64) :: ifile, ofile

  INTEGER(i_knd), PARAMETER :: iunit=10, ounit=11
!_______________________________________________________________________
!
! Commonly used numbers.
!_______________________________________________________________________

  REAL(r_knd), PARAMETER :: zero = 0.0_r_knd
  REAL(r_knd), PARAMETER :: half = 0.5_r_knd
  REAL(r_knd), PARAMETER :: one  = 1.0_r_knd
  REAL(r_knd), PARAMETER :: two  = 2.0_r_knd

  REAL(r_knd), PARAMETER :: pi = 3.14159265358979_r_knd
!_______________________________________________________________________
!_______________________________________________________________________


END MODULE global_module

When the cursor hovers over r_kind, all instances of r_kind should be highlighted, including those representing REAL type suffixes:

Screenshot_20241226_205753

…nal documents; resolves the canonical paths of includes; corrects off-by-one errors on changes to the line numbers from lfortran; adds support for matching completions against all symbols in the document; corrects the completion kinds by mapping them from type SymbolKind to type CompletionItemKind; corrects the mtime type of FileCacheEntry to Date; resolves file paths while extracting definitions; corrects highlighting and query extraction logic by matching against type strings in additional to symbol literals; depends on lfortran when extracting hover previews; removes LFortranLanguageServer.renameSymbol since it has been deprecated and replaced with the analogous method of LFortranCLIAccessor; corrects unit and integration tests for latest changes
Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

I think that looks good, thanks for fixing the bugs!

@certik
Copy link
Contributor

certik commented Dec 27, 2024

I had to resolve some conflicts. Hopefully I did it correctly. If not, you can fix it in subsequent PRs.

@certik
Copy link
Contributor

certik commented Dec 27, 2024

@dylon the CI fails. Let's get this fixed and merged.

We need to do another round of bug hunting. We fixed a lot of things in LFortran, but there might be more issues.

@dylon
Copy link
Collaborator Author

dylon commented Dec 27, 2024

The integration test keeps hitting a timeout while awaiting a DOM state change. I cannot reproduce this locally. I will update the dependencies and try again.

@dylon dylon merged commit 6a5da23 into lfortran:main Dec 27, 2024
5 checks passed
@dylon dylon deleted the dylon/issue-55 branch December 27, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants