Recent

Author Topic: Code completion does not work when using jwaWindows (Solution included)  (Read 644 times)

tboege

  • New Member
  • *
  • Posts: 16
It seems, that FPC 2.2.0 have a bug.
Alle the files in 'C:\lazarus\fpc\3.2.2\source\packages\winunits-jedi\src' are named in lowercase, but the unit name in the files are in mixed case  (eg jwawinnetwk.pas vs "Unit JwaWinNetWk;" inside the file.

Whenever I press ctrl-space to get a completion, it fails with a "CodeTool" error. I dit not manae to fix the source code, but renamed the files with powershell.

Code: Text  [Select][+][-]
  1. $src='C:\lazarus\fpc\3.2.2\source\packages\winunits-jedi\src'
  2. $files= Get-ChildItem -Path $src
  3. foreach ($file in $files){
  4. $FileContent=((Get-Content $file.FullName -First 50 ) -match "Unit .*;") -replace "Unit (.*);",'$1'
  5.  if ($FileContent) {
  6.     $correctFileName= "$FileContent$($File.Extension)"
  7.    if ($File.Name -cne  $correctFileName) {
  8.      $File.Name +' '+  "$FileContent$($File.Extension)"
  9.      Rename-Item -path $File.FullName -NewName $correctFileName
  10.    }
  11.  }
  12.  }

Please file a bug, if you know how to do it...

PascalDragon

  • Hero Member
  • *****
  • Posts: 4972
  • Compiler Developer
Re: Code completion does not work when using jwaWindows (Solution included)
« Reply #1 on: October 16, 2022, 04:25:53 pm »
It seems, that FPC 2.2.0 have a bug.
Alle the files in 'C:\lazarus\fpc\3.2.2\source\packages\winunits-jedi\src' are named in lowercase, but the unit name in the files are in mixed case  (eg jwawinnetwk.pas vs "Unit JwaWinNetWk;" inside the file.

This is not a bug, that is by choice (the names are not case sensitive). If something doesn't work for you then there's a different problem.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8754
  • Debugger - SynEdit - and more
    • wiki
Re: Code completion does not work when using jwaWindows (Solution included)
« Reply #2 on: October 16, 2022, 08:11:29 pm »
Alle the files in 'C:\lazarus\fpc\3.2.2\source\packages\winunits-jedi\src' are named in lowercase, but the unit name in the files are in mixed case  (eg jwawinnetwk.pas vs "Unit JwaWinNetWk;" inside the file.

Whenever I press ctrl-space to get a completion, it fails with a "CodeTool" error. I dit not manae to fix the source code, but renamed the files with powershell.

Codetools doesn't care about the case. (If renaming the files had an effect on your issue, then it was by coincidence => i.e., it triggered something else in addition).

Codetool will show an error in the "messages window" => you did not include what error you were getting.


Maybe codetool had outdated info cached (if you changed fpc version). Try the "Tools" menu: "Rescan fpc source directory".
(changing the case in the file name, or maybe touching their datestamp may have triggered this)

tboege

  • New Member
  • *
  • Posts: 16
Re: Code completion does not work when using jwaWindows (Solution included)
« Reply #3 on: October 17, 2022, 02:28:58 am »
Strange, I have tried to revert to the original src-directory and tried  "Rescan fpc source directory" - but then i cannot get definitions, when I CTRL-mouseclick on a procedure from jwaWindows.
When I change back to the source directory with the cases changed, It works immidialty - without rerunning "Rescan fpc source directory". For me, it is not a problem, since I can get it working in my env. Thank you for your suggestions.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8754
  • Debugger - SynEdit - and more
    • wiki
Re: Code completion does not work when using jwaWindows (Solution included)
« Reply #4 on: October 17, 2022, 12:03:31 pm »
That would maybe indicate a bug in code tools.

I have plenty of units with lowercase filenames, but mixed case unit names.

One think that does afaik not work would be, if you have a case-sensitive filesystem (e.g. linux / Windows normally is case-insensitive) AND you have mixed case filenames that differ from the unitname "unit FooBar" saved as /usr/home/m/fooBAR.pas

 

TinyPortal © 2005-2018