BBx-Kitchen / bbj-language-server

BBj Language Server
MIT License
7 stars 6 forks source link

DEF FN... / FNEND need to be supported #43

Closed StephanWald closed 2 months ago

StephanWald commented 1 year ago

https://documentation.basis.cloud/BASISHelp/WebHelp/commands/bbj-commands/def_verb_bbj.htm

def fnIsText(_f$,_t$)
  rem ' treat this file (filename = _f$, contents = _t$) as plain text?
  rem ' this can be whatever combination of tests works for you.
  print "fnIsText ",_f$," (bytes=",str(len(_t$)),"): ",
  if pos("<html>"=cvs(_t$,8))=1 then print "<html> = html"; return 0
  _f$ = cvs(_f$,8); rem ' lowercase
  if pos(".html"=_f$,-1)=len(_f$)-4 then print ".html = html"; return 0
  if pos(".htm"=_f$,-1)=len(_f$)-3 then print ".htm = html"; return 0
  if pos(".txt"=_f$,-1)=len(_f$)-3 then print ".txt = text"; return 1
  if pos(".src"=_f$,-1)=len(_f$)-3 then print ".src = text"; return 1
  if pos(".properties"=_f$,-1)=len(_f$)-10 then print ".properties = text"; return 1
  print "default to text"; return 1; rem ' pick a default
fnend
StephanWald commented 1 year ago

another sample:

      def fnmode$(mode$)
        if mode$="0" then return "Fat Client"
        if mode$="1" then return "Thin Client"
        if mode$="2" then return "Java Applet"
        if mode$="3" then return "Java Web Start"
        if mode$="4" then return "JavaBBjBridge"
        if mode$="5" then return "GWT Browser"
        return mode$
      fnend
Lotes commented 2 months ago

Closed, because implemented by #139