Module Ide.Utilities

Provide functions for use in the fregIDE

Imports

Table of Content

Definitions

initRootStringIO (Y RTree)

initialize the root of the package tree

justCompiledStringMutableIO URLClassLoaderY RTreeIO (Y RTree)

add a new module

updateCacheApplicative 𝖈 ⇒ 𝖆 → 𝖇 → 𝖈 ()

Remove this package from the package cache

refreshPackagesStIO ()

Force the import to re-create packages next time

newLoaderStIO ()

Make a new loader for operation in the IDE. The rationale is that not making a new loader for every character typed will save time and space.

The IDE code must decide when to make a new loader. For instance, this could be appropriate when the editor is re-activated, because in the meantime other modules could have been rebuild.

magicPNs[([String], 𝖆)] → [([String], 𝖆)]

add magic package names

backwardsJArray TokenInt → [Token]

create a Token list from an JArray backwards

data Proposal

This resembles the SourceProposal class. The additional information must be lazy!

Constructors

Proposal {proposal ∷ String, newText ∷ String, prefix ∷ String, off ∷ Int, len ∷ Int, cursor ∷ Int, additional ∷ IO String}

Member Functions

additionalProposalIO String

Additional information displayed in the pop-up view to the right of the main proposal list view when this proposal is selected.

cursorProposalInt

The offset at which the insertion point should be placed after completing using this proposal, relative to the end of the inserted text.

lenProposalInt

The range of text being replaced.

newTextProposalString

The new text being added/substituted if the user accepts this proposal

offProposalInt

The range of text being replaced.

prefixProposalString

The prefix being completed.

proposalProposalString

The text shown to the user in the popup view

proposeContentGlobalY RTreeIntJArray TokenInt → [Proposal]

Called by Eclipse Content Proposer to make proposals.

Usage: proposeContent global offset tokens index

global
a symbol table, preferably with type information
offset
position of the caret
tokens
array of tokens
index
index into the array, points to the token that starts before the caret
importsGlobal → [(Position, String, String)]

Create a list of triples with position, namespace and package for every import except the automatic ones.

symbolsSymtab → [Symbol]

Create the list of symbols ordered by position

exprSymbolsExprTStG [Symbol]
verbose ∷ (Nice 𝖆, QNameMatcher.QNameMatcher 𝖆) ⇒ GlobalSigmaT 𝖆String
labelGlobalSymbolT aString

Make a label for a symbol

passDoneStG ()

Increment the pass number in the state

thisTabGlobalSymtab

Failure tolerant version of Global.thisTab for use in TreeModelBuilder. In case of syntax errors, there is no symtab yet, hence Global.thisTab is undefined. This, in turn, causes an exception in Eclipse. We can avoid this by just pretending the symbol table was empty.

htmlDocumentationStringStIO String
htmlifyGlobalStringIO String
packDocumentationStringStIO String
symbolDocumentationSymbolStIO String
documentationDocumentationStringStIO String
tokenDocumentationTokenStIO String

This is called from the fregIDE documentation provider when the reference resolver didn't find anything.

This indicates the mouse was not hovering over some identifier.

infixDocGlobalString

find all operators in the current symbol table and tabulate their fixities

correctDependenciesFor[String]String → [String]

Correct the result of frege.compiler.Scanner.dependencies, which returns a singleton list with one element "frege.prelude.PreludeBase" for source files that don't have any import clauses. Yet, unless this is a prelude package itself, "frege.Prelude" will be imported.

This discrepancy leads to files not compiling in the FregIDE builder because they are queued before "frege/Prelude.fr"

getDependenciesCharSequenceStG [String]

Get all the dependencies from a source text

This will be done on a fresh Global

lexPassIDECharSequenceStG (String, Int)

lexical analysis from the IDE does not read files, but takes the content directly

Instances

instance Show Proposal

Member Functions

displayProposalString

inherited from Show.display

showProposalString
showCharsProposal → [Char]

inherited from Show.showChars

showList[Proposal]StringString

inherited from Show.showList

showsPrecIntProposalStringString

inherited from Show.showsPrec

showsubProposalString

inherited from Show.showsub

Functions and Values by Type

Symtab → [Symbol]

symbols

SymbolStIO String

symbolDocumentation

JArray TokenInt → [Token]

backwards

StringMutableIO URLClassLoaderY RTreeIO (Y RTree)

justCompiled

StringStringStringIntIntIntIO StringProposal

Proposal.Proposal

StringStIO String

documentationDocumentation, htmlDocumentation, packDocumentation

StringIO (Y RTree)

initRoot

[String] → String → [String]

correctDependenciesFor

[Proposal] → StringString

Show_Proposal.showList

ExprTStG [Symbol]

exprSymbols

GlobalY RTreeIntJArray TokenInt → [Proposal]

proposeContent

GlobalStringIO String

htmlify

GlobalSymtab

thisTab

GlobalString

infixDoc

Global → [(Position, String, String)]

imports

TokenStIO String

tokenDocumentation

Proposal → (IO StringIO String) → Proposal

Proposal.chg$additional

Proposal → (StringString) → Proposal

Proposal.chg$proposal, Proposal.chg$newText, Proposal.chg$prefix

Proposal → (IntInt) → Proposal

Proposal.chg$off, Proposal.chg$len, Proposal.chg$cursor

ProposalIO StringProposal

Proposal.upd$additional

ProposalStringProposal

Proposal.upd$proposal, Proposal.upd$prefix, Proposal.upd$newText

ProposalIntProposal

Proposal.upd$off, Proposal.upd$len, Proposal.upd$cursor

ProposalIO String

Proposal.additional

ProposalString

Show_Proposal.showsub, Show_Proposal.display, Show_Proposal.show, Proposal.proposal, Proposal.newText, Proposal.prefix

Proposal → [Char]

Show_Proposal.showChars

ProposalInt

Proposal.off, Proposal.len, Proposal.cursor

CharSequenceStG (String, Int)

lexPassIDE

CharSequenceStG [String]

getDependencies

IntProposalStringString

Show_Proposal.showsPrec

StIO ()

newLoader, refreshPackages

StG ()

passDone

[([String], 𝖆)] → [([String], 𝖆)]

magicPNs

GlobalSymbolT a → String

label

𝖆 → Bool

Proposal.has$proposal, Proposal.has$off, Proposal.has$len, Proposal.has$newText, Proposal.has$prefix, Proposal.has$additional, Proposal.has$cursor

(Nice 𝖆, QNameMatcher.QNameMatcher 𝖆) ⇒ GlobalSigmaT 𝖆 → String

verbose

Applicative 𝖈 ⇒ 𝖆 → 𝖇 → 𝖈 ()

updateCache

Valid HTML 4.01 Strict