Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

bug(syntax): fypp highlighting breaks with derived types #715

Closed
1 task done
jphaupt opened this issue Oct 17, 2022 · 3 comments
Closed
1 task done

bug(syntax): fypp highlighting breaks with derived types #715

jphaupt opened this issue Oct 17, 2022 · 3 comments

Comments

@jphaupt
Copy link

jphaupt commented Oct 17, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Description

I noticed fypp support has recently been added, thanks a lot!! I understand it's still new, but I've noticed a little bug:

  • First (I suspect this is something to do with my configuration?) if my file extension is .fpp then it looks like nothing is recognised, there are red squiggles everywhere (I have it configured for Fortran). If I rename it to have .fypp extension and don't change anything else, suddenly it's fine.
  • If I have a derived type that uses the preprocessor, then any code that comes after that derived type loses all syntax highlighting.

In the attached screenshot, all the highlighting goes back the way I expect it to be if I:

  • rename to .fypp
  • remove the derived type

Screenshots

image

Code Example

program highlighting_eg
    use iso_fortran_env, only: sp => real32, dp => real64
    implicit none
    #:for dtype in ['real', 'complex']
    #:for prec in ['sp', 'dp']
    ${dtype}$(${prec}$) :: a_${dtype}$_${prec}$
    #:endfor
    #:endfor

    #:for dtype in ['real', 'complex']
    type literally_anything_${dtype}$_t
    endtype literally_anything_${dtype}$_t
    #:endfor

    contains

    subroutine print(arg)
        real, intent(in) :: arg
        print*, arg
    end subroutine print
end program highlighting_eg

Fortran Version (Free/Fixed Form)

Free Form e.g. F90+

Version of Modern Fortran

v3.2.0

Version of Visual Studio Code

v1.72.2

Platform and Architecture

Linux (OpenSUSE)

Additional Information

I noticed my other issue got sent into discussion. Should this also be there?

@gnikit
Copy link
Member

gnikit commented Oct 17, 2022

So the main thing you noticed is a Duplicate issue of #617. I will not close this just yet as a duplicate because I want to check what you mentioned about the extensions. That is strange indeed.

@jphaupt
Copy link
Author

jphaupt commented Oct 17, 2022

So the main thing you noticed is a Duplicate issue of #617. I will not close this just yet as a duplicate because I want to check what you mentioned about the extensions. That is strange indeed.

Ah sorry, missed the type definition in that issue. Anyway, the extension issue is easy to work around, though a little inconvenient.

@gnikit
Copy link
Member

gnikit commented Oct 17, 2022

I am not able to reproduce the behaviour you pointed out. I was able to get fypp diagnostics for the .fpp file. Is there something else I should be doing to recreate your issue?

image

@fortran-lang fortran-lang locked and limited conversation to collaborators Oct 17, 2022
@gnikit gnikit converted this issue into discussion #717 Oct 17, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants