Giter Site home page Giter Site logo

Comments (2)

aborg0 avatar aborg0 commented on July 20, 2024

Sorry, I am not familiar with github or git, so I do not really know the process of sending patches...
Any case I will copy the content of a patch generated with git to this issue text.

commit a5f736e22b838146d9795ecd2e03192df3802d60
Author: unknown <Gabor@.(none)>
Date: Sun Apr 17 19:18:15 2011 +0200

Updated things to compile with MonoDevelop 2.6 beta2.

diff --git a/src/FSharpInteractivePad.fs b/src/FSharpInteractivePad.fs
index 831b5b6..32004c3 100644
--- a/src/FSharpInteractivePad.fs
+++ b/src/FSharpInteractivePad.fs
@@ -29,12 +29,15 @@ type FSharpInteractivePad() =
let mutable enterHandler = { new IDisposable with member x.Dispose() = () }

let AddSourceToSelection selection =

  • let line = ref 0
    
  • let col  = ref 0
    
  • let stap = IdeApp.Workbench.ActiveDocument.TextEditor.SelectionStartPosition
    
  • IdeApp.Workbench.ActiveDocument.TextEditor.GetLineColumnFromPosition(stap, line, col)
    
  • //let line = ref 0
    
  • //let col  = ref 0
    
  • let stap = IdeApp.Workbench.ActiveDocument.Editor.SelectionRange.Offset
    
  • //IdeApp.Workbench.ActiveDocument.TextEditor.GetLineColumnFromPosition(stap, line, col)
    
  • //let loc = IdeApp.Workbench.ActiveDocument.Editor.OffsetToLocation stap
    
  • let line = IdeApp.Workbench.ActiveDocument.Editor.OffsetToLineNumber stap
    
  • //let col = loc.Column
    

    let file = IdeApp.Workbench.ActiveDocument.FileName

  • String.Format("# {0} \"{1}\"\n{2}" ,line.Value ,file.FullPath,selection)  
    
  • String.Format("# {0} \"{1}\"\n{2}" ,line(*.Value*) ,file.FullPath,selection)  
    

    let rec setupReleaseHandler (ea:Gtk.KeyReleaseEventArgs) =
    enterHandler.Dispose()
    @@ -123,7 +126,7 @@ type FSharpInteractivePad() =

    member x.SendSelection() =
    if x.IsSelectionNonEmpty then

  •  let sel = IdeApp.Workbench.ActiveDocument.TextEditor.SelectedText
    
  •  let sel = IdeApp.Workbench.ActiveDocument.Editor.SelectedText
    

    x.EnsureCorrectDirectory()
    sendCommand (AddSourceToSelection sel) false

@@ -131,8 +134,8 @@ type FSharpInteractivePad() =
if IdeApp.Workbench.ActiveDocument = null then ()
else
x.EnsureCorrectDirectory()

  •  let line = IdeApp.Workbench.ActiveDocument.TextEditor.CursorLine
    
  •  let text = IdeApp.Workbench.ActiveDocument.TextEditor.GetLineText(line)
    
  •  let line = IdeApp.Workbench.ActiveDocument.Editor.Caret.Line
    
  •  let text = IdeApp.Workbench.ActiveDocument.Editor.GetLineText(line)
    

    let file = IdeApp.Workbench.ActiveDocument.FileName
    let sel = String.Format("# {0} "{1}"\n{2}" ,line ,file.FullPath,text)
    sendCommand sel false
    @@ -141,7 +144,7 @@ type FSharpInteractivePad() =
    if IdeApp.Workbench.ActiveDocument = null ||
    IdeApp.Workbench.ActiveDocument.FileName.FileName = null then false
    else

  •  let sel = IdeApp.Workbench.ActiveDocument.TextEditor.SelectedText
    
  •  let sel = IdeApp.Workbench.ActiveDocument.Editor.SelectedText
    

    not(String.IsNullOrEmpty(sel))

    member x.IsInsideFSharpFile =
    diff --git a/src/FSharpLanguageBinding.fs b/src/FSharpLanguageBinding.fs
    index f8ea619..9cda991 100644
    --- a/src/FSharpLanguageBinding.fs
    +++ b/src/FSharpLanguageBinding.fs
    @@ -29,7 +29,7 @@ type FSharpLanguageBinding() =
    // Trigger full parse using the current configuration
    let config = IdeApp.Workspace.ActiveConfiguration
    Debug.tracef "Parsing" "Triggering full parse from OnIdle"

  •  LanguageService.Service.TriggerParse(doc.FileName, doc.TextEditor.Text, doc.Dom, config, full=true)
    
  •  LanguageService.Service.TriggerParse(doc.FileName, doc.Editor.Text, doc.Dom, config, full=true)
    

    true

    // Create or remove Idle timer
    diff --git a/src/FSharpParser.fs b/src/FSharpParser.fs
    index cf54ae1..b8a3047 100644
    --- a/src/FSharpParser.fs
    +++ b/src/FSharpParser.fs
    @@ -10,7 +10,7 @@ type FSharpParsedDocument(fileName) =
    inherit ParsedDocument(fileName)

    type FSharpParser() =

  • inherit AbstractParser("F#", "text/x-fsharp")

  • inherit AbstractParser(("F#", "text/x-fsharp"))

override x.CanParse(fileName) =
Common.supportedExtension(IO.Path.GetExtension(fileName))
diff --git a/src/FSharpTextEditorCompletion.fs b/src/FSharpTextEditorCompletion.fs
index 8a5bc2d..fce54e8 100644
--- a/src/FSharpTextEditorCompletion.fs
+++ b/src/FSharpTextEditorCompletion.fs
@@ -54,7 +54,7 @@ type FSharpTextEditorCompletion() =
override x.CodeCompletionCommand(context:CodeCompletionContext) : ICompletionDataList =
try
let config = IdeApp.Workspace.ActiveConfiguration

  •  let req = x.Document.FileName, x.Document.TextEditor.Text, x.Document.Dom, config
    
  •  let req = x.Document.FileName, x.Document.Editor.Text, x.Document.Dom, config
    

    // Try to get typed information from LanguageService (with the specified timeout)
    let tyRes = LanguageService.Service.GetTypedParseResult(req, timeout = ServiceSettings.blockingTimeout)
    diff --git a/src/Resources/FSharpBinding.addin.xml b/src/Resources/FSharpBinding.addin.xml
    index 139529d..4821e52 100644
    --- a/src/Resources/FSharpBinding.addin.xml
    +++ b/src/Resources/FSharpBinding.addin.xml
    @@ -8,9 +8,9 @@

  •   <Addin id="Core" version="2.4"/>
    
  •   <Addin id="Ide" version="2.4"/>
    
  •   <Addin id="Core" version="2.6"/>
    
  •   <Addin id="Ide" version="2.6"/>
    
diff --git a/src/Services/LanguageService.fs b/src/Services/LanguageService.fs index 6eb8265..452623e 100644 --- a/src/Services/LanguageService.fs +++ b/src/Services/LanguageService.fs @@ -164,21 +164,21 @@ type internal TypedParseResult(info:TypeCheckInfo) = /// Get declarations at the current location in the specified document /// (used to implement dot-completion in 'FSharpTextEditorCompletion.fs') member x.GetDeclarations(doc:Document) = - let lineStr = doc.TextEditor.GetLineText(doc.TextEditor.CursorLine) - let lineStr = doc.Editor.GetLineText(doc.Editor.Caret.Line)

// Get the long identifier before the current location
// 'residue' is the part after the last dot and 'longName' is before
// e.g. System.Console.Wri --> "Wri", [ "System"; "Console"; ]

  • let lookBack = Parsing.createBackStringReader lineStr (doc.TextEditor.CursorColumn - 2)
  • let lookBack = Parsing.createBackStringReader lineStr (doc.Editor.Caret.Column - 2)
    let residue, longName =
    lookBack
    |> Parsing.getFirst Parsing.parseBackIdentWithResidue

Debug.tracef "Result" "GetDeclarations: column: %d, ident: %A\n Line: %s"

  •  (doc.TextEditor.CursorLine - 1) (longName, residue) lineStr
    
  •  (doc.Editor.Caret.Line - 1) (longName, residue) lineStr
    

    let res =
    info.GetDeclarations

  •    ( (doc.TextEditor.CursorLine - 1, doc.TextEditor.CursorColumn - 1), 
    
  •    ( (doc.Editor.Caret.Line - 1, doc.Editor.Caret.Column - 1), 
       lineStr, (longName, residue), 0) // 0 is tokenTag, which is ignored in this case
    

    Debug.tracef "Result" "GetDeclarations: returning %d items" res.Items.Length
    @@ -412,7 +412,7 @@ type internal LanguageService private () =
    Debug.tracef "Errors" "Trigger update after completion"
    let doc = IdeApp.Workbench.ActiveDocument
    if doc.FileName.FullPath = file.FullPath then

  •  ProjectDomService.Parse(file.ToString(), "text/x-fsharp", fun () -> doc.TextEditor.Text) |> ignore
    
  •  ProjectDomService.Parse(file.ToString(), (*"text/x-fsharp",*) fun () -> doc.Editor.Text) |> ignore
    

    updatingErrors <- false

    // ------------------------------------------------------------------------------------

from zarchive-fsharpbinding.

funnelweb avatar funnelweb commented on July 20, 2024

Old issue, closing this out, fixed with recent work for MD 3.0

from zarchive-fsharpbinding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.