Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
Deletes code conditional on unused defines
  - SINGLE_FILE_GENERATOR
  - NOT_YET_NEEDED
  - BETA2
  - IMPLEMENT_IVSPERSISTHIERARCHYITEM2
  - IVsOutliningCapableLanguage
  - CUT
  - DISABLED
  - OLDCODE
  - Suggestion4299
  - UNUSED_DEPENDENT_FILES
  - UNUSED_NESTED_PROJECTS
  - NEVER
  - false
  - UNUSED

closes #353

commit 2839aab40f4e3ab434f0738d5c8e3691d7c2c5df
Author: latkin <latkin@microsoft.com>
Date:   Mon Aug 3 17:22:20 2015 -0700

    Fix merge conflict

commit fc4602bf8b60204d85e707db1438f78cc082cb3d
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 18:15:19 2015 +0200

    remove SINGLE_FILE_GENERATOR

commit 2dc0802e76006c6f5dcceae3360325eba01aea6c
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 18:08:21 2015 +0200

    remove NOT_YET_NEEDED

commit df49b75211747dcd4e0ff887ef4473a280bf4a59
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 18:05:56 2015 +0200

    remove BETA2

commit 70858f0689b29638ebfb35e1c3b0aa149895b801
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 18:05:36 2015 +0200

    remove IMPLEMENT_IVSPERSISTHIERARCHYITEM2

commit d5ec2047ed550db9396892bfbdea28b07bc46193
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 18:02:21 2015 +0200

    remove IVsOutliningCapableLanguage

commit 7f78d984171b4ed22da6339c6b799bbd44e743b3
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 17:55:24 2015 +0200

    remove CUT

commit d781a86012e497dd81fe811250d5efb481c80945
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 17:54:59 2015 +0200

    remove DISABLED

commit d19d387bd38a0b60e688fe6fa40a24d539d5853d
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 17:50:06 2015 +0200

    remove OLDCODE

commit 1997a739aa040aa06428f2d225f7d8771b27f938
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 17:48:02 2015 +0200

    remove Suggestion4299

commit 58cfe73fd9931dfb0276be146dc8d51c04c68c51
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 17:31:29 2015 +0200

    remove UNUSED_DEPENDENT_FILES

commit 790e49786bb74b1c7a3915ed4b4aaf6243543803
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 17:19:47 2015 +0200

    remove UNUSED_NESTED_PROJECTS

commit b738f464175e825dad7abdc55ad0e0e20a36545c
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 17:01:08 2015 +0200

    remove NEVER

commit 1f9dea77c2618eeaadec25edced524d51c21b534
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 16:59:43 2015 +0200

    remove false

commit e43fe145b73c81329c1af18744517bef7deb9da4
Author: enricosada <enrico@sada.io>
Date:   Thu Apr 9 16:57:27 2015 +0200

    remove UNUSED
  • Loading branch information
enricosada authored and latkin committed Aug 4, 2015
1 parent 66d4883 commit 51ff4c5
Show file tree
Hide file tree
Showing 38 changed files with 4 additions and 6,274 deletions.
47 changes: 0 additions & 47 deletions src/fsharp/lib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -341,53 +341,6 @@ type Graph<'Data, 'Id when 'Id : comparison and 'Id : equality>
else List.iter (trace (node.nodeData::path)) node.nodeNeighbours
List.iter (fun node -> trace [] node) nodes

#if OLDCODE

member g.DepthFirstSearch() =
let grey = ref Set.empty
let time = ref 0
let forest = ref []
let backEdges = ref []
let discoveryTimes = ref Map.empty
let finishingTimes = ref Map.empty
nodes |> List.iter (fun n ->
// build a dfsTree for each node in turn
let treeEdges = ref []
let rec visit n1 =
incr time;
grey := Set.add n1.nodeId !grey;
discoveryTimes := Map.add n1.nodeId !time !discoveryTimes;
for n2 in n1.nodeNeighbours do
if not ((!grey).Contains n2.nodeId) then
treeEdges := (n1.nodeId,n2.nodeId) :: !treeEdges;
visit(n2)
else
backEdges := (n1.nodeId,n2.nodeId) :: !backEdges
incr time;
finishingTimes := Map.add n1.nodeId !time !finishingTimes;
()
if not ((!grey).Contains n.nodeId) then
visit(n);
forest := (n.nodeId,!treeEdges) :: !forest);

!forest, !backEdges, (fun n -> (!discoveryTimes).[n]), (fun n -> (!finishingTimes).[n])


// Present strongly connected components, in dependency order
// Each node is assumed to have a self-edge
member g.GetTopologicalSortStronglyConnectedComponents() =
let forest, backEdges, discoveryTimes, finishingTimes = g.DepthFirstSearch()
let nodeIds = List.map (fun n -> n.nodeId) nodes
let nodesInDecreasingFinishingOrder =
List.sortWith (fun n1 n2 -> -(compare (finishingTimes n1) (finishingTimes n2))) nodeIds
let gT = Graph (nodeIdentity, List.map g.GetNodeData nodesInDecreasingFinishingOrder, List.map (fun (x,y) -> (g.GetNodeData y, g.GetNodeData x)) edges)
let forest, backEdges, discoveryTimes, finishingTimes = gT.DepthFirstSearch()
let scc (root,tree) = Set.add root (List.foldBack (fun (n1,n2) acc -> Set.add n1 (Set.add n2 acc)) tree Set.empty)
let sccs = List.rev (List.map scc forest)
List.map (Set.toList >> List.map g.GetNodeData) sccs
#endif


//---------------------------------------------------------------------------
// In some cases we play games where we use 'null' as a more efficient representation
// in F#. The functions below are used to give initial values to mutable fields.
Expand Down
29 changes: 0 additions & 29 deletions src/fsharp/vs/ServiceDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -107,35 +107,6 @@ module internal ItemDescriptionsImpl =

// Format the supertypes and other useful information about a type to a buffer
let OutputUsefulTypeInfo _isDeclInfo (_infoReader:InfoReader) _m _denv _os _ty = ()
#if DISABLED
if false then
ErrorScope.ProtectAndDiscard m (fun () ->
let g = infoReader.g
let amap = infoReader.amap
let supertypes =
let supertypes = AllSuperTypesOfType g amap m AllowMultiIntfInstantiations.Yes ty
let supertypes = supertypes |> List.filter (AccessibilityLogic.IsTypeAccessible g AccessibleFromSomewhere)
let supertypes = supertypes |> List.filter (typeEquiv g g.obj_ty >> not)
let selfs,supertypes = supertypes |> List.partition (typeEquiv g ty)
let supertypesC,supertypesI = supertypes |> List.partition (isInterfaceTy g)
let supertypes = selfs @ supertypesC @ supertypesI
supertypes
let supertypeLs,_ = NicePrint.layoutPrettifiedTypes denv supertypes
// Suppress printing supertypes for enums, delegates, exceptions and attributes
if supertypes.Length > 1 // more then self
&& not (isEnumTy g ty)
&& not (isUnionTy g ty)
&& not (isRecdTy g ty)
&& not (isDelegateTy g ty)
&& not (ExistsHeadTypeInEntireHierarchy g amap m ty g.exn_tcr)
&& not (ExistsHeadTypeInEntireHierarchy g amap m ty g.tcref_System_Attribute) then
bprintf os "\n\n";
List.zip supertypes supertypeLs |> List.iter (fun (superty,supertyL) ->
if typeEquiv g superty ty then bprintf os " %s: %a\n" (FSComp.SR.typeInfoType()) bufferL supertyL
elif isClassTy g superty || isInterfaceTy g ty then bprintf os " %s: %a\n" (FSComp.SR.typeInfoInherits()) bufferL supertyL
else bprintf os " %s: %a\n" (FSComp.SR.typeInfoImplements()) bufferL supertyL))
#endif


let rangeOfPropInfo (pinfo:PropInfo) =
match pinfo with
Expand Down
29 changes: 0 additions & 29 deletions src/utils/sformat.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1159,31 +1159,6 @@ namespace Microsoft.FSharp.Text.StructuredFormat
// pprinter: leafFormatter
// --------------------------------------------------------------------

#if Suggestion4299
// See bug 4299. Suppress FSI_dddd+<etc> from fsi printer.
let fixupForInteractiveFSharpClassesWithNoToString obj (text:string) =
// Given obj:T.
// If T is a nested type inside a parent type called FSI_dddd, then it looks like an F# Interactive type.
// Further, if the .ToString() text starts with "FSI_dddd+T" then it looks like it's the default ToString.
// A better test: it is default ToString if the MethodInfo.DeclaringType is System.Object.
// In this case, replace "FSI_dddd+T" by "T".
// assert(obj <> null)
let fullName = obj.GetType().FullName // e.g. "FSI_0123+Name"
let name = obj.GetType().Name // e.g. "Name"
let T = obj.GetType()
if text.StartsWith(fullName) then
// text could be a default .ToString() since it starts with the FullName of the type. More checks...
if T.IsNested &&
T.DeclaringType.Name.StartsWith("FSI_") && // Name has "FSI_" which is
T.DeclaringType.Name.Substring(4) |> Seq.forall System.Char.IsDigit // followed by digits?
then
name ^ text.Substring(fullName.Length) // replace fullName by name at start of text
else
text
else
text
#endif

let leafFormatter (opts:FormatOptions) (obj :obj) =
match obj with
| null -> "null"
Expand Down Expand Up @@ -1219,10 +1194,6 @@ namespace Microsoft.FSharp.Text.StructuredFormat
| :? bool as b -> (if b then "true" else "false")
| :? char as c -> "\'" + formatChar true c + "\'"
| _ -> try let text = obj.ToString()
//Suggestion4299. Not yet fixed.
//#if COMPILER
// let text = fixupForInteractiveFSharpClassesWithNoToString obj text
//#endif
text
with e ->
// If a .ToString() call throws an exception, catch it and use the message as the result.
Expand Down
36 changes: 0 additions & 36 deletions vsintegration/src/Salsa/VsMocks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1222,39 +1222,6 @@ module internal VsMocks =
member this.UnadviseFileChange(vscookie) = nothing()
}

#if NOT_YET_NEEDED
let vsExtensibility3 =
{ new IVsExtensibility3 with
member this.GetProperties(pParent, pdispPropObj, ppProperties) = err(__LINE__)
member this.RunWizardFile(bstrWizFilename, hwndOwner, vContextParams, pResult) = err(__LINE__)
member this.EnterAutomationFunction() = err(__LINE__)
member this.ExitAutomationFunction() = err(__LINE__)
member this.IsInAutomationFunction(pfInAutoFunc) = err(__LINE__)
member this.GetUserControl( fUserControl) = err(__LINE__)
member this.SetUserControl( fUserControl) = err(__LINE__)
member this.SetUserControlUnlatched( fUserControl) = err(__LINE__)
member this.LockServer( vb) = err(__LINE__)
member this.GetLockCount( pCount) = err(__LINE__)
member this.TestForShutdown( fShutdown) = err(__LINE__)
member this.GetGlobalsObject( extractFrom, ppGlobals) = err(__LINE__)
member this.GetConfigMgr( pIVsProject, itemid, ppCfgMgr) = err(__LINE__)
member this.FireMacroReset() = err(__LINE__)
member this.GetDocumentFromDocCookie( lDocCookie, ppDoc) = err(__LINE__)
member this.IsMethodDisabled( pGUID, dispid) = err(__LINE__)
member this. SetSuppressUI( In) = err(__LINE__)
member this.GetSuppressUI( pOut) = err(__LINE__)
member this.FireProjectsEvent_ItemAdded( project) = err(__LINE__)
member this.FireProjectsEvent_ItemRemoved( project) = err(__LINE__)
member this.FireProjectsEvent_ItemRenamed( project, oldName) = err(__LINE__)
member this.FireProjectItemsEvent_ItemAdded( projectItem) = err(__LINE__)
member this.FireProjectItemsEvent_ItemRemoved( projectItem) = err(__LINE__)
member this.FireProjectItemsEvent_ItemRenamed( projectItem, oldName) = err(__LINE__)
member this.IsFireCodeModelEventNeeded( vbNeeded) = err(__LINE__)
member this.RunWizardFileEx( bstrWizFilename, hwndOwner, vContextParams, vCustomParams, pResult) = err(__LINE__)
member this.FireCodeModelEvent3( dispid, pParent, pElement, changeKind) = err(__LINE__)
}
#endif

let vsSolution =
{ new IVsSolution with
member x.GetProjectEnum(grfEnumFlags, rguidEnumOnlyThisType, ppenum) = err(__LINE__)
Expand Down Expand Up @@ -1566,9 +1533,6 @@ module internal VsMocks =
sp.AddService(typeof<SVsTaskList>, box(vsTaskList()), false)
sp.AddService(typeof<SVsShellMonitorSelection>, box vsMonitorSelection, false)
sp.AddService(typeof<SVsFileChangeEx>, box vsFileChangeManager, false)
#if NOT_YET_NEEDED
sp.AddService(typeof<EnvDTE.IVsExtensibility>, box vsExtensibility3, false)
#endif
sp.AddService(typeof<SVsSolution>, box vsSolution, false)
sp.AddService(typeof<SVsSolutionBuildManager>, box vsSolutionBuildManager, false)
sp.AddService(typeof<SVsRunningDocumentTable>, box vsRunningDocumentTable, false)
Expand Down
Loading

0 comments on commit 51ff4c5

Please sign in to comment.